#!/bin/sh # /etc/rcS.d/S98init_nas runs this script in the background with argument start # and copies it to /etc/rcK_init.d (so it will be called at shutdown with argument stop) # to be stored in /dev/mtd5 case $1 in start) # wait for optware init while ( test -z "$(grep /opt/bin /etc/profile)" ); do sleep 10; done # get new shell settings (PATH ...) . /etc/profile # Run all start scripts in /opt/etc/init.d # executing them in numerical order. # for i in /opt/etc/init.d/S??* ;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. $i start ;; esac done ;; stop) # Run all stop scripts in /opt/etc/init.d # executing them in numerical order. # for i in /opt/etc/init.d/K??* ;do # Ignore dangling symlinks (if any). [ ! -f "$i" ] && continue case "$i" in *.sh) # Source shell script for speed. ( trap - INT QUIT TSTP set stop . $i ) ;; *) # No sh extension, so fork subprocess. $i stop ;; esac done ;; esac