#!/bin/sh PATH=/bin:/sbin:/command echo 'Stopping getties...' svc -d /service/getty-* svwaitdown -t14 /service/getty-* || ( echo 'Killing getties...' ; \ svc -k /service/getty-* ; svwaitdown /service/getty-* ) echo 'Stopping services...' svc -d /service/* svwaitdown -t350 /service/* || ( echo 'Killing services...' ; \ svc -k /service/* ; svwaitdown /service/* ) echo 'Stopping log services...' svc -d /service/*/log svwaitdown -t35 /service/*/log || ( echo 'Killing log services...' ; \ svc -k /service/*/log ; svwaitdown /service/*/log ) echo 'Shutdown...' if test -r /etc/runit/reboot; then exec reboot else exec halt fi exit 0