summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpackage/base-files/src/etc/init.d/rcK22
-rwxr-xr-xpackage/base-files/src/etc/init.d/rcS22
2 files changed, 36 insertions, 8 deletions
diff --git a/package/base-files/src/etc/init.d/rcK b/package/base-files/src/etc/init.d/rcK
index 9859f300a..8bff46cc6 100755
--- a/package/base-files/src/etc/init.d/rcK
+++ b/package/base-files/src/etc/init.d/rcK
@@ -1,18 +1,32 @@
#!/bin/sh
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
: ${rcquiet=0}
+if test x"$rcquiet" = x"0" && sh -n /etc/rc.conf >/dev/null 2>&1; then
+ . /etc/rc.conf
+ unset rcquiet
+ rcquiet=0
+else
+ unset rcquiet
+ rcquiet=1
+fi
{
grep '^#INIT ' /etc/init.d/* | \
sort -rnk2 | \
while read line; do
- test x"$rcquiet" = x"0" && echo -n "Stopping ${line%%:*}... "
+ rcenabled=NO
+ rcname=${line%%:*}
+ rcname=${rcname##*/}
+ test x"$rcquiet" = x"0" && eval 'rcenabled=${'"${rcname}"':-NO}'
+ test x"$rcenabled" = x"NO" || echo -n "Stopping ${rcname}... "
sh ${line%%:*} autostop
rc=$?
- case $rcquiet:$rc in
- (0:0)
+ case $rcenabled:$rc in
+ (NO:*)
+ ;;
+ (*:0)
echo done.
;;
- (0:*)
+ (*:*)
echo "failed ($rc)."
;;
esac
diff --git a/package/base-files/src/etc/init.d/rcS b/package/base-files/src/etc/init.d/rcS
index 77137e6d3..3a58d4d17 100755
--- a/package/base-files/src/etc/init.d/rcS
+++ b/package/base-files/src/etc/init.d/rcS
@@ -7,18 +7,32 @@ ln -s /proc/self/fd/2 /dev/stderr
echo "System initialization ..."
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
: ${rcquiet=0}
+if test x"$rcquiet" = x"0" && sh -n /etc/rc.conf >/dev/null 2>&1; then
+ . /etc/rc.conf
+ unset rcquiet
+ rcquiet=0
+else
+ unset rcquiet
+ rcquiet=1
+fi
{
grep '^#INIT ' /etc/init.d/* | \
sort -nk2 | \
while read line; do
- test x"$rcquiet" = x"0" && echo -n "Starting ${line%%:*}... "
+ rcenabled=NO
+ rcname=${line%%:*}
+ rcname=${rcname##*/}
+ test x"$rcquiet" = x"0" && eval 'rcenabled=${'"${rcname}"':-NO}'
+ test x"$rcenabled" = x"NO" || echo -n "Starting ${rcname}... "
sh ${line%%:*} autostart
rc=$?
- case $rcquiet:$rc in
- (0:0)
+ case $rcenabled:$rc in
+ (NO:*)
+ ;;
+ (*:0)
echo done.
;;
- (0:*)
+ (*:*)
echo "failed ($rc)."
;;
esac