aboutsummaryrefslogtreecommitdiff
path: root/sh/rc-functions.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'sh/rc-functions.sh.in')
-rw-r--r--sh/rc-functions.sh.in21
1 files changed, 21 insertions, 0 deletions
diff --git a/sh/rc-functions.sh.in b/sh/rc-functions.sh.in
index 2a656bc8..ee9c9833 100644
--- a/sh/rc-functions.sh.in
+++ b/sh/rc-functions.sh.in
@@ -84,6 +84,27 @@ get_bootparam()
return 1
}
+# Called from runscript.sh or gendepends.sh
+_depend() {
+ depend
+ local _rc_svcname=$(shell_var "$RC_SVCNAME") _deptype= _depends=
+
+ # Add any user defined depends
+ for _deptype in config:CONFIG need:NEED use:USE \
+ after:AFTER before:BEFORE \
+ provide:PROVIDE keyword:KEYWORD; do
+ IFS=:
+ set -- $_deptype
+ unset IFS
+ eval _depends=\$rc_${_rc_svcname}_$1
+ [ -z "$_depends" ] && eval _depends=\$rc_$1
+ [ -z "$_depends" ] && eval _depends=\$RC_${_rc_svcname}_$2
+ [ -z "$_depends" ] && eval _depends=\$RC_$2
+
+ $1 $_depends
+ done
+}
+
# Add our sbin to $PATH
case "$PATH" in
"$RC_LIBEXECDIR"/sbin|"$RC_LIBEXECDIR"/sbin:*);;