slitaz-boot-scripts view etc/init.d/rc.shutdown @ rev 9

Add the shutdown script and one for local command
author Christophe Lincoln <pankso@slitaz.org>
date Fri Nov 30 12:35:42 2007 +0100 (2007-11-30)
parents
children 177e91b4a3fa
line source
1 #!/bin/sh
2 # /etc/init.d/rc.shutdown - This script is used by /etc/inittab to stop
3 # all demons and shutdown the system.
4 #
5 . /etc/init.d/rc.functions
6 . /etc/rcS.conf
8 echo ""
9 echo "========"
10 echo ""
11 echo -e "\033[1m System is going down for reboot or halt.\033[0m"
12 echo ""
13 echo "========"
14 echo ""
16 # Stop all daemons started at boot time.
17 echo "Stoping all demons started at boot time..."
18 for daemon in $RUN_DAEMONS
19 do
20 if [ -x /etc/init.d/$daemon ]; then
21 /etc/init.d/$daemon stop
22 fi
23 done
25 # Sync all filesystems.
26 echo -n "Syncing all filesystems... "
27 sync
28 status && sleep 2
30 # Swap off.
31 echo -n "Disabling swap space... "
32 /sbin/swapoff -a
33 status && sleep 2
35 # Umount filesystems.
36 echo -n "Unmounting all filesystems... "
37 /bin/umount -a -r
38 #status