From 53c5ad6fa854740c2a5d36f748577a349c1432e9 Mon Sep 17 00:00:00 2001 From: nbd Date: Fri, 8 Dec 2006 17:56:05 +0000 Subject: 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 --- package/base-files/files/etc/rc.common | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'package/base-files/files') diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index 7180b0f7f..1e6c5e912 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;; -- cgit v1.2.3