2005-01-16 19:43:02 +08:00
|
|
|
#!/bin/sh
|
2006-06-27 08:36:13 +08:00
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
|
2009-05-01 06:59:18 +08:00
|
|
|
run_scripts() {
|
|
|
|
for i in /etc/rc.d/$1*; do
|
|
|
|
[ -x $i ] && $i $2 2>&1
|
|
|
|
done | $LOGGER
|
|
|
|
}
|
|
|
|
|
2010-04-17 02:14:08 +08:00
|
|
|
system_config() {
|
|
|
|
config_get_bool foreground $1 foreground 0
|
|
|
|
}
|
|
|
|
|
2009-03-18 21:05:18 +08:00
|
|
|
LOGGER="cat"
|
2009-04-21 20:02:34 +08:00
|
|
|
[ -x /usr/bin/logger ] && LOGGER="logger -s -p 6 -t sysinit"
|
2009-03-18 21:05:18 +08:00
|
|
|
|
2012-06-06 00:04:23 +08:00
|
|
|
. /lib/functions.sh
|
2010-04-14 03:57:25 +08:00
|
|
|
|
|
|
|
config_load system
|
2010-04-17 02:14:08 +08:00
|
|
|
config_foreach system_config system
|
2010-04-14 03:57:25 +08:00
|
|
|
|
2010-04-17 02:14:08 +08:00
|
|
|
if [ "$1" = "S" -a "$foreground" != "1" ]; then
|
2009-05-01 06:59:18 +08:00
|
|
|
run_scripts "$1" "$2" &
|
|
|
|
else
|
|
|
|
run_scripts "$1" "$2"
|
|
|
|
fi
|