summaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-07-27 09:02:10 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-07-27 09:02:10 +0000
commit2ed51448ae64a1c4883ce7c76befce1f357b457e (patch)
tree331c1b3e48cd87a05d458a0796132e7761adb413 /package/base-files/files/etc
parentd572d07324ac143c835ad8eef1b0c2b8eab52fca (diff)
base-files: warn when calling /etc/init.d/<script> enable and neither START nor STOP is defined
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27797 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/etc')
-rwxr-xr-xpackage/base-files/files/etc/rc.common4
1 files changed, 4 insertions, 0 deletions
diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common
index 6ec88aef9..5bf357b9a 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -42,6 +42,10 @@ disable() {
enable() {
name="$(basename "${initscript}")"
disable
+ [ -n "$START" -o -n "$STOP" ] || {
+ echo "/etc/init.d/$name does not have a START or STOP value"
+ return 1
+ }
[ "$START" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}"
[ "$STOP" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}"
}