#!/bin/sh # $Id$ . /etc/rc.subr if [ "$1" = "S" ]; then echo cat /bootmotd echo fi shells= COLS=`tput cols` find /etc/rc$1.d -name "S??*.sh" | grep -q "." if [ "$?" = "0" ]; then for i in `find /etc/rc$1.d -name "S??*.sh"`; do if [ "$shells" = "" ]; then shells="$i" else shells="$shells $i" fi printf "\r\x1b[`expr $COLS - 5`G\x1b[1m[\x1b[31m....\x1b[m\x1b[1m]\x1b[m\r" $i if [ "$?" = "0" ]; then printf "\r\x1b[`expr $COLS - 5`G\x1b[1m[\x1b[33m OK \x1b[m\x1b[1m]\x1b[m" else printf "\r\x1b[`expr $COLS - 5`G\x1b[1m[\x1b[31mFAIL\x1b[m\x1b[1m]\x1b[m" fi echo done fi for i in `find /etc/rc$1.d -name "S??*" -and -not -name "S??README"`; do runshell="0" for j in $shells; do if [ "$j" = "$i" ]; then runshell="1" break fi done if [ "$runshell" = "0" ]; then if [ "$1" = "1" -o "$1" = "6" ]; then $i stop else $i start fi fi done echo if [ "$1" = "1" -o "$1" = "0" ]; then /sbin/shutdown -Phn now elif [ "$1" = "6" ]; then /sbin/shutdown -rn now fi