slitaz-boot-scripts rev 23 1.4

Shutdown/reboot starting with progress bar
author Christophe Lincoln <pankso@slitaz.org>
date Fri Feb 15 15:02:26 2008 +0100 (2008-02-15)
parents a993095d2da8
children fcbb99288f65
files etc/init.d/rc.functions etc/init.d/rc.shutdown
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/etc/init.d/rc.functions	Fri Feb 15 15:02:26 2008 +0100
     1.3 @@ -0,0 +1,27 @@
     1.4 +# /etc/init.d/rc.functions: SliTaz boot scripts functions.
     1.5 +#
     1.6 +
     1.7 +# Status functions.
     1.8 +status()
     1.9 +{
    1.10 +	local CHECK=$?
    1.11 +	echo -en "\\033[70G[ "
    1.12 +	if [ $CHECK = 0 ]; then
    1.13 +		echo -en "\\033[1;33mOK"
    1.14 +	else
    1.15 +		echo -en "\\033[1;31mFailed"
    1.16 +	fi
    1.17 +	echo -e "\\033[0;39m ]"
    1.18 +}
    1.19 +
    1.20 +# An other way to sleep.
    1.21 +usleep_progress()
    1.22 +{
    1.23 +	CHAR='='
    1.24 +	for i in `seq 80-1`
    1.25 +	do
    1.26 +		echo -n "$CHAR"
    1.27 +		usleep 28000
    1.28 +	done
    1.29 +	echo "$CHAR"
    1.30 +}
     2.1 --- a/etc/init.d/rc.shutdown	Fri Feb 15 14:04:57 2008 +0100
     2.2 +++ b/etc/init.d/rc.shutdown	Fri Feb 15 15:02:26 2008 +0100
     2.3 @@ -5,12 +5,15 @@
     2.4  . /etc/init.d/rc.functions
     2.5  . /etc/rcS.conf
     2.6  
     2.7 +# Message with progress bar
     2.8 +echo -e "
     2.9 +================================================================================
    2.10 +
    2.11 +    \033[1mSystem is going down for reboot or halt.\033[0m
    2.12 +
    2.13 +    Uptime:`uptime`"
    2.14  echo ""
    2.15 -echo "========"
    2.16 -echo ""
    2.17 -echo -e "\033[1m        System is going down for reboot or halt.\033[0m"
    2.18 -echo ""
    2.19 -echo "========"
    2.20 +usleep_progress
    2.21  echo ""
    2.22  
    2.23  # Stop all daemons started at boot time.
    2.24 @@ -42,4 +45,4 @@
    2.25  mount -o remount,ro /
    2.26  status
    2.27  echo "Unmounting all filesystems... "
    2.28 -/bin/umount -a
    2.29 +/bin/umount -a -r