aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-07-27 09:02:10 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-07-27 09:02:10 +0000
commit667740bb3f3a221a6cc8adc9ebdd7f4ecab1c2f0 (patch)
tree331c1b3e48cd87a05d458a0796132e7761adb413 /package
parent6292b0603fa50509274785b6c7f07b708d0dc248 (diff)
downloadupstream-667740bb3f3a221a6cc8adc9ebdd7f4ecab1c2f0.tar.gz
upstream-667740bb3f3a221a6cc8adc9ebdd7f4ecab1c2f0.tar.bz2
upstream-667740bb3f3a221a6cc8adc9ebdd7f4ecab1c2f0.zip
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')
-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 6ec88aef9c..5bf357b9a8 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]}"
}