openrc/init.d/halt.in
2008-11-03 16:16:12 +00:00

26 lines
515 B
Plaintext

#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# This script really belongs with the Linux sysvinit package
description="Halt or reboot the host depending on sysvinit runlevel."
depend()
{
after *
use romount
keyword noprefix
}
start()
{
case "${RUNLEVEL}" in
0) runlevel=shutdown;;
6) runlevel=reboot;;
*) eerror "Unknown runlevel ${RUNLEVEL}"; return 1
esac
. /etc/init.d/"${runlevel}".sh
return 0
}