From 1ccba056584ee1a8e09fb1d5eebd988b47912c06 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Fri, 22 Sep 2017 17:22:50 -0500 Subject: [PATCH] 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