summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorRoman Kyrylych <roman@archlinux.org>2008-03-08 20:02:09 +0200
committerRoman Kyrylych <roman@archlinux.org>2008-03-08 20:18:11 +0200
commit2c9681f461a0cde98a88de65e232369df68ed859 (patch)
tree4bb297b334f4265b3effe1e15d9ae359be13d17d /functions
parent45e331302268490cfb532ea6fe827cba1351ec5b (diff)
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 <roman@archlinux.org>
Diffstat (limited to 'functions')
-rw-r--r--functions8
1 files changed, 8 insertions, 0 deletions
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