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
parentc46adf14343df3a74aef7e4ae5be175ae5fa7a01 (diff)
sh/rc-functions.sh: add need_if_exists convenience function
-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 7b771f82..d6336a18 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