diff options
author | Roman Kyrylych <roman@archlinux.org> | 2008-03-08 20:02:09 +0200 |
---|---|---|
committer | Roman Kyrylych <roman@archlinux.org> | 2008-03-08 20:18:11 +0200 |
commit | 2c9681f461a0cde98a88de65e232369df68ed859 (patch) | |
tree | 4bb297b334f4265b3effe1e15d9ae359be13d17d /functions | |
parent | 45e331302268490cfb532ea6fe827cba1351ec5b (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-- | functions | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 |