#!/bin/sh
exec 2>&1

PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin

LAST=0
test -x /etc/runit/reboot && LAST=6

echo 'Waiting for getties to stop...'
svwaitdown -xk -t14 /var/service/getty-*

echo 'Waiting for services to stop...'
svwaitdown -xk -t350 /var/service/*

echo 'Shutdown...'
/etc/rc.d/rc.$LAST