3
# halt Execute the halt command.
5
# Version: @(#)halt 2.85-22 19-Jun-2004 miquels@cistron.nl
8
PATH=/sbin:/bin:/usr/sbin:/usr/bin
10
# Get the default from /etc/default/halt.
8
# Short-Description: Execute the halt command.
14
PATH=/sbin:/usr/sbin:/bin:/usr/bin
11
15
[ -f /etc/default/halt ] && . /etc/default/halt
13
if [ "$INIT_HALT" = "" ]
17
. /lib/lsb/init-functions
20
if [ "$INIT_HALT" = "" ]
28
# See if we need to cut the power.
29
if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
31
/etc/init.d/ups-monitor poweroff
34
# Don't shut down drives if we're using RAID.
36
if grep -qs '^md.*active' /proc/mdstat
41
# If INIT_HALT=HALT don't poweroff.
43
if [ "$INIT_HALT" = "HALT" ]
48
halt -d -f -i $poweroff $hddown
35
# See if we need to cut the power.
36
if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
38
/etc/init.d/ups-monitor poweroff
41
# Don't shut down drives if we're using RAID.
43
if grep -qs '^md.*active' /proc/mdstat
48
# If INIT_HALT=HALT don't poweroff.
50
if [ "$INIT_HALT" = "HALT" ]
55
# Make it possible to not shut down network interfaces,
56
# needed to use wake-on-lan
58
if [ "$NETDOWN" = "no" ]; then
62
log_action_msg "Will now halt"
63
halt -d -f $netdown $poweroff $hddown
70
restart|reload|force-reload)
71
echo "Error: argument '$1' not supported" >&2
78
echo "Usage: $0 start|stop" >&2