#!/bin/sh # /etc/init.d/rc - runlevel change script PATH=/sbin:/bin SCRIPT_DIR="/etc/rc$1.d" # Check that the rcN.d directory really exists. if [ -d $SCRIPT_DIR ]; then # See if the system is switching runlevels or if it was just booted. if ! [ "$PREVLEVEL" = "N" ]; then # Switching runlevels so execute the kill scripts. for SCRIPT in $SCRIPT_DIR/K*; do if [ -x "$SCRIPT" ]; then $SCRIPT stop; fi; done; fi # Always do the start scripts regardless of previous system state. for SCRIPT in $SCRIPT_DIR/S*; do if [ -x $SCRIPT ]; then $SCRIPT start; fi; done; fi