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