commit:     1ccba056584ee1a8e09fb1d5eebd988b47912c06
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Fri Sep 22 22:22:50 2017 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Sep 22 22:22:50 2017 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=1ccba056

sh/rc-functions.sh: add need_if_exists convenience function

 sh/rc-functions.sh.in | 7 +++++++
 1 file changed, 7 insertions(+)

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

Reply via email to