* Re-wrote/cleaned up init scripts * Re-wrote init-functions * Moved some things (init scripts, defaults, configs) to other packages * Added update-rc which manages /etc/rc* directories * Added usher to manage defaults
40 lines
642 B
Bash
Executable File
40 lines
642 B
Bash
Executable File
#!/bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: halt
|
|
# Required-Start:
|
|
# Required-Stop:
|
|
# Should-Start:
|
|
# Should-Stop:
|
|
# Default-Start:
|
|
# Default-Stop: 0
|
|
# Short-Description: Halt the system
|
|
# X-Required: true
|
|
### END INIT INFO
|
|
|
|
. /lib/lsb/init-functions
|
|
[ -r /etc/default/halt ] && . /etc/default/halt
|
|
|
|
case "$1" in
|
|
stop)
|
|
poweroff='-p'
|
|
netdown='-i'
|
|
|
|
if [ "$HALT" == "halt" ]; then
|
|
poweroff=''
|
|
fi
|
|
|
|
if [ "$NETDOWN" == "no" ]; then
|
|
netdown=''
|
|
fi
|
|
|
|
log_init_msg "Halting system"
|
|
halt -d -f $netdown $poweroff
|
|
;;
|
|
*)
|
|
echo "Usage: [stop]"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|