#! /bin/sh
#
# rcS		Call all S??* scripts in /etc/rcS.d in
#		numerical/alphabetical order.
#
# Version:	@(#)/etc/init.d/rcS  1.10  06-Nov-1997  miquels@cistron.nl
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin
runlevel=S
prevlevel=N
umask 022
export PATH runlevel prevlevel

#
#	See if system needs to be setup.
#
if [ -x /sbin/unconfigured.sh ]
then
  /sbin/unconfigured.sh
fi

#
#	Source defaults.
#
. /etc/default/rcS
export VERBOSE

#
#	Call all parts in order.
#
for i in /etc/rcS.d/S??*
do
	# Ignore dangling symlinks for now.
	[ ! -f "$i" ] && continue

	case "$i" in
		*.sh)
			# Source shell script for speed.
			. $i
			;;
		*)
			# No sh extension, so fork subprocess.
			$i start
			;;
	esac
done

#
#	For compatibility, run the files in /etc/rc.boot too.
#
[ -d /etc/rc.boot ] && run-parts /etc/rc.boot

#
#	Finish setup if needed.
#
if [ -x /sbin/setup.sh ]
then
  /sbin/setup.sh
fi

