#!/bin/sh


# Start or stop all init scripts in /etc/init.d
# executing them in numerical order.
#

if [ "$1" = stop ]; then
	prefix=K
else
	prefix=S
fi
	
for i in /etc/init.d/$prefix??* ;do

     # Ignore dangling symlinks (if any).
     [ ! -f "$i" ] && continue

     case "$i" in
	*.sh)
	    # Source shell script for speed.
	    (
		trap - INT QUIT TSTP
		set start
		. $i
	    )
	    ;;
	*)
	    # No sh extension, so fork subprocess.
	    if [ $prefix = K ]; then
		$i stop
	    else
		$i start
	    fi
	    ;;
    esac
done

