From 614685b48a17d44b077b03c69a4d32b007578018 Mon Sep 17 00:00:00 2001 From: Victor Lowther Date: Mon, 7 Jun 2010 08:04:51 -0500 Subject: Bashify rc.multi Change the daemon running loop to use a case statement. This is shorter and easier to read. Quote daemon names. Someday, someone may have a daemon name with a space in it. --- rc.multi | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'rc.multi') diff --git a/rc.multi b/rc.multi index a7ea703..660f649 100755 --- a/rc.multi +++ b/rc.multi @@ -9,20 +9,18 @@ run_hook multi_start # Load sysctl variables if sysctl.conf is present -[ -r /etc/sysctl.conf ] && /sbin/sysctl -q -p &>/dev/null +[[ -r /etc/sysctl.conf ]] && /sbin/sysctl -q -p &>/dev/null # Start daemons for daemon in "${DAEMONS[@]}"; do - if [ "$daemon" = "${daemon#!}" ]; then - if [ "$daemon" = "${daemon#@}" ]; then - start_daemon $daemon - else - start_daemon_bkgd ${daemon:1} - fi - fi + case ${daemon:0:1} in + '!') continue;; # Skip this daemon. + '@') start_daemon_bkgd "${daemon#@}";; + *) start_daemon "$daemon";; + esac done -if [ -x /etc/rc.local ]; then +if [[ -x /etc/rc.local ]]; then /etc/rc.local fi -- cgit v1.2.3