[arch-projects] [initscripts] [PATCH 13/13] functions: Cosmetics: Refactor usage of local daemon variables
Kurt J. Bosch
kjb-temp-2009 at alpenjodel.de
Tue Jul 12 12:11:06 EDT 2011
---
functions | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/functions b/functions
index 93b7ab7..8e31b79 100644
--- a/functions
+++ b/functions
@@ -196,9 +196,9 @@ have_daemon() {
# Check if $1 is started at boot
ck_autostart() {
- local d
- for d in "${DAEMONS[@]}"; do
- [[ $1 = "${d#@}" ]] && return 1
+ local daemon
+ for daemon in "${DAEMONS[@]}"; do
+ [[ $1 = "${daemon#@}" ]] && return 1
done
return 0
}
@@ -276,10 +276,11 @@ stop_all_daemons() {
done
# Shutdown daemons in reverse order
- local i
+ local i daemon
for (( i=${#DAEMONS[@]}-1; i>=0; i-- )); do
[[ ${DAEMONS[i]} = '!'* ]] && continue
- ck_daemon "${DAEMONS[i]#@}" || stop_daemon "${DAEMONS[i]#@}"
+ daemon=${DAEMONS[i]#@}
+ ck_daemon "$daemon" || stop_daemon "$daemon"
done
}
--
1.7.1
More information about the arch-projects
mailing list