# HG changeset patch # User Christophe Lincoln # Date 1203084146 -3600 # Node ID e122131b9ad6980687d5c8ba35ebaf1385495416 # Parent a993095d2da80dc5543c6a7e7085af2854242ad2 Shutdown/reboot starting with progress bar diff -r a993095d2da8 -r e122131b9ad6 etc/init.d/rc.functions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/etc/init.d/rc.functions Fri Feb 15 15:02:26 2008 +0100 @@ -0,0 +1,27 @@ +# /etc/init.d/rc.functions: SliTaz boot scripts functions. +# + +# Status functions. +status() +{ + local CHECK=$? + echo -en "\\033[70G[ " + if [ $CHECK = 0 ]; then + echo -en "\\033[1;33mOK" + else + echo -en "\\033[1;31mFailed" + fi + echo -e "\\033[0;39m ]" +} + +# An other way to sleep. +usleep_progress() +{ + CHAR='=' + for i in `seq 80-1` + do + echo -n "$CHAR" + usleep 28000 + done + echo "$CHAR" +} diff -r a993095d2da8 -r e122131b9ad6 etc/init.d/rc.shutdown --- a/etc/init.d/rc.shutdown Fri Feb 15 14:04:57 2008 +0100 +++ b/etc/init.d/rc.shutdown Fri Feb 15 15:02:26 2008 +0100 @@ -5,12 +5,15 @@ . /etc/init.d/rc.functions . /etc/rcS.conf +# Message with progress bar +echo -e " +================================================================================ + + \033[1mSystem is going down for reboot or halt.\033[0m + + Uptime:`uptime`" echo "" -echo "========" -echo "" -echo -e "\033[1m System is going down for reboot or halt.\033[0m" -echo "" -echo "========" +usleep_progress echo "" # Stop all daemons started at boot time. @@ -42,4 +45,4 @@ mount -o remount,ro / status echo "Unmounting all filesystems... " -/bin/umount -a +/bin/umount -a -r