aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-12-08 17:56:05 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-12-08 17:56:05 +0000
commit9a5798e5f5d052405c2468878e654bf302036372 (patch)
tree6a87aff4ee26b78eab3e1c7b7e9af5a411300a4b /package/base-files/files/etc
parent4bead05b286388f205a21f3d14be3e7c3e063e3d (diff)
downloadupstream-9a5798e5f5d052405c2468878e654bf302036372.tar.gz
upstream-9a5798e5f5d052405c2468878e654bf302036372.tar.bz2
upstream-9a5798e5f5d052405c2468878e654bf302036372.zip
add a check to see if an init script is enabled
SVN-Revision: 5727
Diffstat (limited to 'package/base-files/files/etc')
-rwxr-xr-xpackage/base-files/files/etc/rc.common6
1 files changed, 6 insertions, 0 deletions
diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common
index 7180b0f7fa..1e6c5e912b 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -41,6 +41,11 @@ enable() {
ln -s "/etc/init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}"
}
+enabled() {
+ name="$(basename "${initscript}")"
+ [ -x "$IPKG_INSTROOT/etc/rc.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;;