Files
initscripts/SRC/initscripts/init.d/halt
Jay Larson 3112172beb This package has gone through significant changes:
* 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
2017-05-16 16:44:05 -05:00

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