#!/bin/sh exec >/dev/console 2>&1 PATH=/sbin:/usr/sbin:/bin:/usr/bin echo 'Waiting for getties to stop...' if type -p sv > /dev/null ; then sv shutdown -w 10 /var/service/getty-* else svwaitdown -xk -t10 /var/service/getty-* fi echo 'Waiting for services to stop...' if type -p sv > /dev/null ; then sv shutdown -w 300 /var/service/* else svwaitdown -xk -t300 /var/service/* fi echo 'Shutdown...' test -x /etc/runit/reboot && LAST=6 || LAST=0 test -x /etc/runit/reboot && RC=reboot || RC=shutdown RUNLEVEL=$LAST /sbin/rc $RC