base-files: warn when calling /etc/init.d/<script> enable and neither START nor STOP...
authorFelix Fietkau <nbd@openwrt.org>
Wed, 27 Jul 2011 09:02:10 +0000 (09:02 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 27 Jul 2011 09:02:10 +0000 (09:02 +0000)
SVN-Revision: 27797

package/base-files/files/etc/rc.common

index 6ec88aef9c1e20040bb605235207f0ca0d4ee79b..5bf357b9a89050440e02d910af4234d0e8a74685 100755 (executable)
@@ -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]}"
 }