add K* scripts to be run at shutdown

SVN-Revision: 7163
This commit is contained in:
Mike Baker 2007-05-10 10:07:38 +00:00
parent 15e9bc4f26
commit 291420a8f3
6 changed files with 16 additions and 8 deletions

View File

@ -2,6 +2,8 @@
# Copyright (C) 2006 OpenWrt.org
START=40
STOP=40
boot() {
setup_switch() { return 0; }

View File

@ -1,10 +1,8 @@
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
(
for i in /etc/rc.d/S*; do
$i boot 2>&1
{
for i in /etc/rc.d/$1*; do
$i $2 2>&1
done
sysctl -p >&-
) | logger -s -p 6 -t '' &
} | logger -s -p 6 -t '' &

View File

@ -0,0 +1,7 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=99
start() {
[ -f /etc/sysctl.conf ] && sysctl -p >&-
}

View File

@ -1,3 +1,4 @@
::sysinit:/etc/init.d/rcS
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
tts/0::askfirst:/bin/ash --login
ttyS0::askfirst:/bin/ash --login

View File

@ -12,4 +12,3 @@ alias more=less
arp() { cat /proc/net/arp; }
[ -z /bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
reboot() { ifdown wan 2>&1 >/dev/null ; /sbin/reboot; }

View File

@ -40,6 +40,7 @@ enable() {
name="$(basename "${initscript}")"
disable
ln -s "/etc/init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}"
[ "$STOP" ] && ln -s "/etc/init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${START}${name##K[0-9][0-9]}"
}
enabled() {