]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/rc.d/rc.halt
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848...
[people/pmueller/ipfire-2.x.git] / src / rc.d / rc.halt
1 #!/bin/sh
2 #
3 # $Id: rc.halt,v 1.4.2.2 2005/07/07 20:11:58 franck78 Exp $
4 #
5 echo "Stopping the RED interface..."
6 /etc/rc.d/rc.red stop 2>/dev/null
7 /etc/rc.d/rc.red clear 2>/dev/null
8 echo "Shutting down..."
9 sleep 3
10 echo "Saving the clock"
11 /sbin/hwclock --systohc
12 echo "Sending all processes the TERM signal..."
13 /sbin/killall5 -15
14 sleep 3
15 echo "Sending all processes the KILL signal..."
16 /sbin/killall5 -9
17 sleep 3
18
19 if [ -e /etc/FLASH ]; then
20 if [ -e /etc/rc.d/rc.flash.down ]; then
21 echo "Compressing logs"
22 . /etc/rc.d/rc.flash.down
23 fi
24 fi
25
26 echo "Turning off swap"
27 swapoff -a
28 echo "Unmounting others"
29 umount -n -a
30 echo "Unmounting root"
31 mount -n -o remount,ro /
32
33 # Send nice shutdown beep now
34 /usr/bin/beep -l 75 -f 3000
35 /usr/bin/beep -l 75 -f 2000
36 /usr/bin/beep -l 75 -f 1000
37 /usr/bin/beep -l 75 -f 500
38
39 if [ "$1" = "halt" ]; then
40 halt -i -d -p
41 else
42 reboot -i -d
43 fi