[package] option to allow boot to run to completion before starting shell
[openwrt.git] / package / base-files / files / etc / init.d / rcS
1 #!/bin/sh
2 # Copyright (C) 2006 OpenWrt.org
3
4 run_scripts() {
5         for i in /etc/rc.d/$1*; do
6                 [ -x $i ] && $i $2 2>&1
7         done | $LOGGER
8 }
9
10 LOGGER="cat"
11 [ -x /usr/bin/logger ] && LOGGER="logger -s -p 6 -t sysinit"
12
13 . /etc/functions.sh
14
15 config_load system
16 config_get_bool foreground system foreground no
17
18 if [ "$1" = "S" -a "$foreground" != "yes" ]; then
19         run_scripts "$1" "$2" &
20 else
21         run_scripts "$1" "$2"
22 fi