Show spinner

This commit is contained in:
Bob Mottram 2017-06-11 22:19:15 +01:00
parent fccc78c627
commit c1f9920cb3
1 changed files with 10 additions and 32 deletions

View File

@ -51,48 +51,26 @@ function include_source {
source $1 source $1
} }
#please_wait please_wait
utils_files=0 spin='-\|/'
i=0
UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-* UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*
for f in $UTILS_FILES for f in $UTILS_FILES
do do
utils_files=$((utils_files + 1)) i=$(( (i+1) %4 ))
printf "\r${spin:$i:1}"
source $f
done done
apps_files=0
APP_FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-* APP_FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
for f in $APP_FILES for f in $APP_FILES
do do
apps_files=$((apps_files + 1)) i=$(( (i+1) %4 ))
printf "\r${spin:$i:1}"
source $f
done done
UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*
file_ctr=0
dialog --title "$PROJECT_NAME" --gauge "Loading utils..." 7 75 < <(
for f in $UTILS_FILES
do
echo "$((file_ctr * 100 / utils_files))";
cat <<EOF
source $f
EOF
file_ctr=$((file_ctr + 1))
done
)
APP_FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
file_ctr=0
dialog --title "$PROJECT_NAME" --gauge "Loading apps..." 7 75 < <(
for f in $APP_FILES
do
echo "$((file_ctr * 100 / apps_files))";
cat <<EOF
source $f
EOF
file_ctr=$((file_ctr + 1))
done
)
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
SELECTED_USERNAME= SELECTED_USERNAME=
SIP_CONFIGURATION_FILE=/etc/sipwitch.conf SIP_CONFIGURATION_FILE=/etc/sipwitch.conf