aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2017-09-22 17:22:50 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-09-22 17:22:50 -0500
commit1ccba056584ee1a8e09fb1d5eebd988b47912c06 (patch)
treeda7c3ff4e0991b89b46686ccff936d3d610ad01d
parentman/openrc-run.8: Clarify the explanation of the need dependency (diff)
downloadopenrc-master.zip
openrc-master.tar.gz
openrc-master.tar.bz2
sh/rc-functions.sh: add need_if_exists convenience functionHEADmaster
-rw-r--r--sh/rc-functions.sh.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/sh/rc-functions.sh.in b/sh/rc-functions.sh.in
index 7b771f8..d6336a1 100644
--- a/sh/rc-functions.sh.in
+++ b/sh/rc-functions.sh.in
@@ -119,6 +119,13 @@ get_bootparam_value()
echo $result
}
+need_if_exists()
+{
+ for x; do
+ rc-service --exists "${x}" && need "${x}"
+ done
+}
+
# Called from openrc-run.sh or gendepends.sh
_get_containers() {
local c