summaryrefslogtreecommitdiff
path: root/package/base-files
diff options
context:
space:
mode:
authorMike Baker <mbm@openwrt.org>2007-05-10 10:07:38 +0000
committerMike Baker <mbm@openwrt.org>2007-05-10 10:07:38 +0000
commit291420a8f3552a1b48af4fc7418e5ca15c9ece3d (patch)
tree9b7d8719ef6ba95938d03930681caa1e730f8b81 /package/base-files
parent15e9bc4f266000ae86b912c3920690d0d3c70b73 (diff)
downloadmtk-20170518-291420a8f3552a1b48af4fc7418e5ca15c9ece3d.zip
mtk-20170518-291420a8f3552a1b48af4fc7418e5ca15c9ece3d.tar.gz
mtk-20170518-291420a8f3552a1b48af4fc7418e5ca15c9ece3d.tar.bz2
add K* scripts to be run at shutdown
SVN-Revision: 7163
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/etc/init.d/network2
-rwxr-xr-xpackage/base-files/files/etc/init.d/rcS10
-rwxr-xr-xpackage/base-files/files/etc/init.d/sysctl7
-rw-r--r--package/base-files/files/etc/inittab3
-rw-r--r--package/base-files/files/etc/profile1
-rwxr-xr-xpackage/base-files/files/etc/rc.common1
6 files changed, 16 insertions, 8 deletions
diff --git a/package/base-files/files/etc/init.d/network b/package/base-files/files/etc/init.d/network
index 950b337..eab0011 100755
--- a/package/base-files/files/etc/init.d/network
+++ b/package/base-files/files/etc/init.d/network
@@ -2,6 +2,8 @@
# Copyright (C) 2006 OpenWrt.org
START=40
+STOP=40
+
boot() {
setup_switch() { return 0; }
diff --git a/package/base-files/files/etc/init.d/rcS b/package/base-files/files/etc/init.d/rcS
index 755e08b..61c1d6d 100755
--- a/package/base-files/files/etc/init.d/rcS
+++ b/package/base-files/files/etc/init.d/rcS
@@ -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 '' &
diff --git a/package/base-files/files/etc/init.d/sysctl b/package/base-files/files/etc/init.d/sysctl
new file mode 100755
index 0000000..35d5e30
--- /dev/null
+++ b/package/base-files/files/etc/init.d/sysctl
@@ -0,0 +1,7 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+START=99
+start() {
+ [ -f /etc/sysctl.conf ] && sysctl -p >&-
+}
diff --git a/package/base-files/files/etc/inittab b/package/base-files/files/etc/inittab
index 3d92717..d7a053a 100644
--- a/package/base-files/files/etc/inittab
+++ b/package/base-files/files/etc/inittab
@@ -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
diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index 001fb20..8aac3b7 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -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; }
diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common
index 5d9ee86..7ca1078 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -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() {