add a check to see if an init script is enabled
authorFelix Fietkau <nbd@openwrt.org>
Fri, 8 Dec 2006 17:56:05 +0000 (17:56 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 8 Dec 2006 17:56:05 +0000 (17:56 +0000)
SVN-Revision: 5727

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

index 8b478f0dcc4f0182e6ce34b81b7ae17fc0a38274..ef944b5ae74d08741e8da74785f4c5122fa2e34d 100755 (executable)
@@ -41,6 +41,11 @@ enable() {
        ln -s "/etc/init.d/$name" "$IPKG_INSTROOT/etc/init.d/S${START}${name##S[0-9][0-9]}"
 }
 
+enabled() {
+       name="$(basename "${initscript}")"
+       [ -x "$IPKG_INSTROOT/etc/init.d/S${START}${name##S[0-9][0-9]}" ]
+}
+
 depends() {
        return 0
 }
@@ -77,6 +82,7 @@ eval "case \"\$action\" in
        boot) boot;;
        shutdown) shutdown;;
        enable) enable;;
+       enabled) enabled;;
        disable) disable;;
        $cmds
        *) help;;