From 6fd038ed8b83f8a06a0a954a1093b2ed3e47803c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 8 Dec 2006 17:56:05 +0000 Subject: [PATCH] add a check to see if an init script is enabled SVN-Revision: 5727 --- openwrt/package/base-files/default/etc/rc.common | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openwrt/package/base-files/default/etc/rc.common b/openwrt/package/base-files/default/etc/rc.common index 8b478f0dcc..ef944b5ae7 100755 --- a/openwrt/package/base-files/default/etc/rc.common +++ b/openwrt/package/base-files/default/etc/rc.common @@ -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;; -- 2.30.2