@@ -15,6 +15,7 @@ LOG="/root/hst_install_backups/hst_install-$(date +%d%m%Y%H%M).log"
1515memory=$( grep ' MemTotal' /proc/meminfo | tr ' ' ' \n' | grep [0-9])
1616hst_backups=" /root/hst_install_backups/$( date +%d%m%Y%H%M) "
1717arch=$( uname -i)
18+ spinner=" /-\|"
1819os=' ubuntu'
1920release=" $( lsb_release -s -r) "
2021codename=" $( lsb_release -s -c) "
466467# ----------------------------------------------------------#
467468
468469# Updating system
469- echo " Upgrade System using apt-get..."
470- apt-get -y upgrade >> $LOG
470+ echo -e " Upgrade System using apt-get... "
471+ apt-get -y upgrade >> $LOG &
472+ BACK_PID=$!
473+
474+ # Check if package installation is done, print a spinner
475+ spin_i=1
476+ while kill -0 $BACK_PID 2> /dev/null ; do
477+ printf " \b${spinner: spin_i++% ${# spinner} : 1} "
478+ sleep 0.5
479+ done
480+
481+ # Do a blank echo to get the \n back
482+ echo
483+
484+ # Check Installation result
471485check_result $? ' apt-get upgrade failed'
472486
473487# Define apt conf location
@@ -666,14 +680,15 @@ echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d
666680chmod a+x /usr/sbin/policy-rc.d
667681
668682# Installing apt packages
669- echo -ne " \n\nWe will now install HestiaCP and all required packages. The process will take around 10-15 minutes."
683+ echo -ne " \n\nWe will now install HestiaCP and all required packages. The process will take around 10-15 minutes. "
670684apt-get -y install $software >> $LOG &
671685BACK_PID=$!
672686
673- # Check if package installation is done
687+ # Check if package installation is done, print a spinner
688+ spin_i=1
674689while kill -0 $BACK_PID 2> /dev/null ; do
675- echo -n " . "
676- sleep 2
690+ printf " \b ${spinner : spin_i++ % ${ # spinner} : 1} "
691+ sleep 0.5
677692done
678693
679694# Do a blank echo to get the \n back
@@ -1241,8 +1256,15 @@ if [ "$clamd" = 'yes' ]; then
12411256 gpasswd -a clamav Debian-exim > /dev/null 2>&1
12421257 cp -f $hestiacp /clamav/clamd.conf /etc/clamav/
12431258 update-rc.d clamav-daemon defaults
1244- echo " Updating ClamAV..."
1245- /usr/bin/freshclam >> $LOG
1259+ echo -ne " Updating ClamAV... "
1260+ /usr/bin/freshclam >> $LOG &
1261+ BACK_PID=$!
1262+ spin_i=1
1263+ while kill -0 $BACK_PID 2> /dev/null ; do
1264+ printf " \b${spinner: spin_i++% ${# spinner} : 1} "
1265+ sleep 0.5
1266+ done
1267+ echo
12461268 service clamav-daemon start
12471269 check_result $? " clamav-daemon start failed"
12481270fi
0 commit comments