]> git.ipfire.org Git - ipfire-2.x.git/blob - src/rc.d/rc.halt
Geaendert:
[ipfire-2.x.git] / src / rc.d / rc.halt
1 #!/bin/sh
2 #
3 # rc.halt for ipfire 2006
4 #
5
6 progressbar()
7 {
8 if [ $# != 1 ]
9 then
10 echo "Usage: progressbar {progress}"
11 exit 1
12 fi
13 echo "show $(( 65534 * $1 / 9 ))" > /proc/splash
14 }
15 # Set bootsplash
16 progressbar 9
17 echo "silent" > /proc/splash
18
19 echo "Stopping the RED interface..."
20 progressbar 8
21 /etc/rc.d/rc.red stop 2>/dev/null
22 /etc/rc.d/rc.red clear 2>/dev/null
23
24 echo "Shutting down..."
25 progressbar 7
26 sleep 3
27
28 echo "Saving the clock"
29 progressbar 6
30 /sbin/hwclock --systohc
31
32 echo "Sending all processes the TERM signal..."
33 progressbar 5
34 /sbin/killall5 -15
35 sleep 3
36
37 echo "Sending all processes the KILL signal..."
38 progressbar 4
39 /sbin/killall5 -9
40 sleep 3
41
42 echo "Turning off swap"
43 progressbar 3
44 swapoff -a
45
46 echo "Unmounting others"
47 progressbar 2
48 umount -n -a
49
50 echo "Unmounting root"
51 progressbar 1
52 mount -n -o remount,ro /
53
54 # Send nice shutdown beep now
55 progressbar 0
56 /usr/bin/beep -l 75 -f 3000
57 /usr/bin/beep -l 75 -f 2000
58 /usr/bin/beep -l 75 -f 1000
59 /usr/bin/beep -l 75 -f 500
60
61 if [ "$1" = "halt" ]; then
62 halt -i -d -p
63 else
64 reboot -i -d
65 fi