FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 06-30-2010, 09:47 PM
Victor Lowther
 
Default Change the daemon running loop to use a case statement.

This is shorter and easier to read.
---
rc.multi | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/rc.multi b/rc.multi
index 46c18df..ec6fda6 100755
--- a/rc.multi
+++ b/rc.multi
@@ -13,13 +13,11 @@ run_hook multi_start

# 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
--
1.7.1
 

Thread Tools




All times are GMT. The time now is 04:45 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org