]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/rc.d/rc.halt
Geaendert:
[people/teissler/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
13 echo "show $(( 65534 * $1 / 9 ))" > /proc/splash
14}
15# Set bootsplash
20e891c6 16progressbar 9
15852942
MT
17echo "silent" > /proc/splash
18
cd1a2927 19echo "Stopping the RED interface..."
20e891c6 20progressbar 8
cd1a2927
MT
21/etc/rc.d/rc.red stop 2>/dev/null
22/etc/rc.d/rc.red clear 2>/dev/null
15852942 23
cd1a2927 24echo "Shutting down..."
20e891c6 25progressbar 7
cd1a2927 26sleep 3
15852942 27
cd1a2927 28echo "Saving the clock"
20e891c6 29progressbar 6
cd1a2927 30/sbin/hwclock --systohc
15852942 31
cd1a2927 32echo "Sending all processes the TERM signal..."
20e891c6 33progressbar 5
cd1a2927
MT
34/sbin/killall5 -15
35sleep 3
15852942 36
cd1a2927 37echo "Sending all processes the KILL signal..."
20e891c6 38progressbar 4
cd1a2927
MT
39/sbin/killall5 -9
40sleep 3
41
cd1a2927 42echo "Turning off swap"
20e891c6 43progressbar 3
cd1a2927 44swapoff -a
15852942 45
cd1a2927 46echo "Unmounting others"
20e891c6 47progressbar 2
cd1a2927 48umount -n -a
15852942 49
cd1a2927 50echo "Unmounting root"
20e891c6 51progressbar 1
cd1a2927
MT
52mount -n -o remount,ro /
53
54# Send nice shutdown beep now
20e891c6 55progressbar 0
cd1a2927
MT
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
61if [ "$1" = "halt" ]; then
62 halt -i -d -p
63else
64 reboot -i -d
65fi