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

Store last alsa settings on shutdown
author Christophe Lincoln <pankso@slitaz.org>
date Sun Mar 08 00:13:46 2009 +0100 (2009-03-08)
parents 58cc6775e0f0
children 979868f40866
line source
1 #!/bin/sh
2 # /etc/init.d/rc.shutdown - This script is used by /etc/inittab to stop
3 # all daemons and shutdown the system.
4 #
5 . /etc/init.d/rc.functions
6 . /etc/rcS.conf
8 clear && sleep 1
10 # Bold info message with uptime
11 echo ""
12 echo -e "
13 ================================================================================
15 \033[1mSystem is going down for reboot or halt.\033[0m
17 Uptime:`uptime`
19 ================================================================================"
20 echo ""
22 # Store last alsa settings.
23 if [ -x /usr/sbin/alsactl ]; then
24 echo -n "Storing alsa sound settings..."
25 alsactl store
26 status
27 fi
29 # Stop all daemons started at boot time.
30 echo "Stoping all demons started at boot time..."
31 for daemon in $RUN_DAEMONS
32 do
33 if [ -x /etc/init.d/$daemon ]; then
34 /etc/init.d/$daemon stop
35 fi
36 done
38 # Sync all filesystems.
39 echo -n "Syncing all filesystems... "
40 sync
41 status && sleep 1
43 # Swap off.
44 echo -n "Disabling swap space... "
45 /sbin/swapoff -a
46 status
48 # Kill all processes.
49 echo -n "Killing all processes..."
50 killall5
52 # Umount filesystems.
53 echo -n "Remonting rootfs read only..."
54 mount -o remount,ro /
55 status
56 echo "Unmounting all filesystems... "
57 /bin/umount -a -r
59 echo ""
60 usleep_progress
61 echo ""