]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/initscripts/init.d/functions
Add wireless client for RED to startup process.
[ipfire-2.x.git] / src / initscripts / init.d / functions
index d50421dfd04f299ecb6889a9c37caa1b399891d2..e2e058d38b9d081aea1519d91e8a3832a4b9b02c 100644 (file)
@@ -22,12 +22,12 @@ export PATH="/bin:/usr/bin:/sbin:/usr/sbin"
 RELOADSIG="HUP"
 
 # Number of seconds between STOPSIG and FALLBACK when stopping processes
-KILLDELAY="3"
+KILLDELAY="10"
 
 ## Screen Dimensions
 # Find current screen size
 if [ -z "${COLUMNS}" ]; then
-       COLUMNS=$(stty size)
+       COLUMNS=$(stty size 2>/dev/null)
        COLUMNS=${COLUMNS##* }
 fi
 
@@ -152,12 +152,12 @@ print_error_msg()
        boot_mesg_flush
        boot_mesg -n "If you're able to track this"
        boot_mesg -n " error down to a bug in one of the files provided by"
-       boot_mesg -n " the LFS book, please be so kind to inform us at"
-       boot_mesg " lfs-dev@linuxfromscratch.org.\n"
+       boot_mesg -n " ipfire, please be so kind to inform us at"
+       boot_mesg " info@ipfire.org.\n"
        boot_mesg_flush
-       boot_mesg -n "Press Enter to continue..." ${INFO}
+       boot_mesg -n "Press Enter to continue or wait a minute..." ${INFO}
        boot_mesg "" ${NORMAL}
-       read ENTER
+       read -t 60 ENTER
 }
 
 check_script_status()
@@ -438,7 +438,7 @@ loadproc()
 {
        local pidfile=""
        local forcestart=""
-       local nicelevel="10"
+       local nicelevel=""
 
 # This will ensure compatibility with previous LFS Bootscripts
        if [ -n "${PIDFILE}" ]; then
@@ -500,7 +500,13 @@ loadproc()
                esac
        fi
 
-       nice -n "${nicelevel}" "${@}"
+       local cmd="${@}"
+
+       if [ -n "${nicelevel}" ]; then
+               cmd="nice -n "${nicelevel}" ${cmd}"
+       fi
+
+       ${cmd}
        evaluate_retval # This is "Probably" not LSB compliant, but required to be compatible with older bootscripts
        return 0
 }
@@ -679,4 +685,21 @@ log_warning_msg() {
        return 0
 }
 
+run_subdir() {
+       DIR=$1
+       for i in $(ls -v ${DIR}* 2> /dev/null); do
+               check_script_status
+               OUT=$(echo $(basename ${i}) | awk -F- '{ print $2 }')
+               case "$OUT" in
+                       S) ${i} start   ;;
+                       K) ${i} stop ;;
+                       RS) ${i} restart ;;
+                       RL) ${i} reload ;;
+                       U) ${i} up ;;
+                       D) ${i} down ;;
+                       *) ${i} ;;
+               esac
+       done
+}
+
 # End $rc_base/init.d/functions