]> git.ipfire.org Git - ipfire-2.x.git/blame - src/rc.d/rc.halt
HinzugefĆ¼gt:
[ipfire-2.x.git] / src / rc.d / rc.halt
CommitLineData
cd1a2927
MT
1#!/bin/sh
2#
3# $Id: rc.halt,v 1.4.2.2 2005/07/07 20:11:58 franck78 Exp $
4#
5echo "Stopping the RED interface..."
6/etc/rc.d/rc.red stop 2>/dev/null
7/etc/rc.d/rc.red clear 2>/dev/null
8echo "Shutting down..."
9sleep 3
10echo "Saving the clock"
11/sbin/hwclock --systohc
12echo "Sending all processes the TERM signal..."
13/sbin/killall5 -15
14sleep 3
15echo "Sending all processes the KILL signal..."
16/sbin/killall5 -9
17sleep 3
18
19if [ -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
24fi
25
26echo "Turning off swap"
27swapoff -a
28echo "Unmounting others"
29umount -n -a
30echo "Unmounting root"
31mount -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
39if [ "$1" = "halt" ]; then
40 halt -i -d -p
41else
42 reboot -i -d
43fi