#!/bin/sh # Copyright 2002, Microbrew Software (soon to be Inc.) # This file is a part of Microbrew Linux (x86 Brew), a system administrator's # distribution, and is distributed under the GNU GPL yadda yadda yadda. # XXX fixme # $Id$ if [ -z "$RUNLEVEL" ]; then case $0 in *rcS) RUNLEVEL=S;; *rc1) RUNLEVEL=1;; *rc2) RUNLEVEL=2;; *rc3) RUNLEVEL=3;; *rc4) RUNLEVEL=4;; *rc5) RUNLEVEL=5;; *rc6) RUNLEVEL=6;; *rc0) RUNLEVEL=0;; *) echo "Aiee, could not determine desired runlevel. Punting to sulogin..." # To quote an unnamed SMI engineer, this is a clear act of desperation. /sbin/sulogin < /dev/console ;; esac fi if [ "$RUNLEVEL" = "3" ]; then RUNLEVEL=2 /etc/rc2 fi if [ -d /etc/rc$RUNLEVEL.d ]; then # echo "In runlevel $RUNLEVEL..." for i in /etc/rc$RUNLEVEL.d/K*; do if [ -x $i ]; then # echo $i STOP case $i in *.sh) . $i;; *) $i stop;; esac # echo $i DONE fi done # echo "Still in runlevel $RUNLEVEL..." for i in /etc/rc$RUNLEVEL.d/S*; do if [ -x $i ]; then # echo $i START case $i in *.sh) . $i;; *) $i start;; esac # echo $i DONE fi done # echo "Done running $RUNLEVEL start scripts..." # echo "ls /etc/rc$RUNLEVEL.d/S*" # ls /etc/rc$RUNLEVEL.d/S* fi