#!/sbin/runscript description="Halt or reboot the host depending on sysvinit runlevel." depend() { after * use mount-ro keyword noprefix } start() { case "${RUNLEVEL}" in 0) runlevel=shutdown;; 6) runlevel=reboot;; *) eerror "Unknown runlevel ${RUNLEVEL}"; return 1 esac . /etc/"${runlevel}".sh return 0 }