From 2c9681f461a0cde98a88de65e232369df68ed859 Mon Sep 17 00:00:00 2001 From: Roman Kyrylych Date: Sat, 8 Mar 2008 20:02:09 +0200 Subject: Add basic support for dependencies in rc.d scripts Example of use: DEPENDS=('dbus' 'acpid') . . . ck_depends ${DEPENDS[@]} and those daemons will be started if not running already Signed-off-by: Roman Kyrylych --- functions | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'functions') diff --git a/functions b/functions index bbc773c..4a4b05a 100644 --- a/functions +++ b/functions @@ -143,6 +143,14 @@ ck_daemon() { return 0 } +ck_depends() { + for daemon in $@; do + if ck_daemon $daemon; then + /etc/rc.d/$daemon start + fi + done +} + source_functions() { if [ -d /etc/rc.d/functions.d/ ]; then for f in $(/bin/ls /etc/rc.d/functions.d/); do -- cgit v1.2.3