diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-12-08 17:56:05 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2006-12-08 17:56:05 +0000 |
commit | 6c20cfaf1d6441a3c26abdf20cc7cd538202813f (patch) | |
tree | 0d9e201796d7dcfa69d06f7d1de0c5cc830a0bc2 /package/base-files/files/etc | |
parent | d6b8219de1d1552d3ef5a21fde9efa1f3d61e6b0 (diff) | |
download | upstream-6c20cfaf1d6441a3c26abdf20cc7cd538202813f.tar.gz upstream-6c20cfaf1d6441a3c26abdf20cc7cd538202813f.tar.bz2 upstream-6c20cfaf1d6441a3c26abdf20cc7cd538202813f.zip |
add a check to see if an init script is enabled
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5727 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/etc')
-rwxr-xr-x | package/base-files/files/etc/rc.common | 6 |
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;; |