aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-07-12 17:38:27 +0200
committerTom Gundersen <teg@jklm.no>2011-07-17 21:38:00 +0200
commit1ff5031122b1d16fbeb9c5e00ef366e4527c00ef (patch)
treea944d2ec3647d413a339b328d95a124901bf91b8 /functions
parent81c36b2f88b03b098bcf41a9036dfe06d081c74f (diff)
downloadinitscripts-1ff5031122b1d16fbeb9c5e00ef366e4527c00ef.tar.xz
functions: Cosmetics: Refactor usage of local daemon variables
Diffstat (limited to 'functions')
-rw-r--r--functions11
1 files changed, 6 insertions, 5 deletions
diff --git a/functions b/functions
index 79da659..1cfcf28 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
}