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