#!/bin/sh # # rc.halt for ipfire 2006 # progressbar() { if [ $# != 1 ] then echo "Usage: progressbar {progress}" exit 1 fi if [ -e /proc/splash ]; then echo "show $(( 65534 * $1 / 9 ))" > /proc/splash fi } # Set bootsplash progressbar 0 if [ -e /proc/splash ]; then echo "silent" > /proc/splash fi echo "Stopping the RED interface..." progressbar 1 /etc/rc.d/rc.red stop 2>/dev/null /etc/rc.d/rc.red clear 2>/dev/null echo "Shutting down..." progressbar 2 sleep 3 echo "Saving the clock" progressbar 3 /sbin/hwclock --systohc echo "Sending all processes the TERM signal..." progressbar 4 /sbin/killall5 -15 sleep 3 echo "Sending all processes the KILL signal..." progressbar 5 /sbin/killall5 -9 sleep 3 echo "Turning off swap" progressbar 6 swapoff -a echo "Unmounting others" progressbar 7 umount -n -a echo "Unmounting root" progressbar 8 mount -n -o remount,ro / # Send nice shutdown beep now progressbar 9 /usr/bin/beep -l 75 -f 3000 /usr/bin/beep -l 75 -f 2000 /usr/bin/beep -l 75 -f 1000 /usr/bin/beep -l 75 -f 500 if [ "$1" = "halt" ]; then halt -i -d -p else reboot -i -d fi