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