aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2019-04-20 22:24:46 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2019-04-20 22:33:35 -0700
commitc78662eeafaf5f9254f62ae1f40f7c058180af8a (patch)
tree8ec8be03b16a1fb3de6c7eab56261b97ea258b93
parentinit.d/net.lo.in: shellcheck: PROVIDEDBY MODULE trample (diff)
downloadnetifrc-c78662eeafaf5f9254f62ae1f40f7c058180af8a.tar.gz
netifrc-c78662eeafaf5f9254f62ae1f40f7c058180af8a.tar.bz2
netifrc-c78662eeafaf5f9254f62ae1f40f7c058180af8a.zip
init.d/net.lo.in: shellcheck: _load_modules
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--init.d/net.lo.in14
1 files changed, 8 insertions, 6 deletions
diff --git a/init.d/net.lo.in b/init.d/net.lo.in
index a958598..c8af39f 100644
--- a/init.d/net.lo.in
+++ b/init.d/net.lo.in
@@ -430,13 +430,13 @@ _load_modules()
fi
MODULES=
- if [ "${IFACE}" != "lo" -a "${IFACE}" != "lo0" ]; then
+ if [ "${IFACE}" != "lo" ] && [ "${IFACE}" != "lo0" ]; then
eval mymods=\$modules_${IFVAR}
# shellcheck disable=SC2154
[ -z "${mymods}" ] && mymods=${modules}
fi
- local i=-1 x= mod= f= provides=
+ local i=-1 x='' mod='' f='' provides=''
while true; do
: $(( i += 1 ))
eval mod=\$module_${i}
@@ -446,7 +446,7 @@ _load_modules()
eval set -- \$module_${i}_program
if [ -n "$1" ]; then
if ! _program_available "$@" >/dev/null; then
- vewarn "Skipping module $mod due to missing program: $@"
+ vewarn "Skipping module $mod due to missing program: $*"
continue
fi
fi
@@ -457,7 +457,7 @@ _load_modules()
fi
if [ -n "$1" ]; then
if ! _program_available "$@" >/dev/null; then
- vewarn "Skipping module $mod due to missing program: $@"
+ vewarn "Skipping module $mod due to missing program: $*"
continue
fi
fi
@@ -483,7 +483,8 @@ _load_modules()
# Wrap our provides
local f=
for f in pre_start start post_start; do
- eval "${provides}_${f}() { [ "$(command -v "${mod}_${f}")" = "${mod}_${f}" ] || return 0; ${mod}_${f} \"\$@\"; }"
+ inner=$(command -v "${mod}_${f}")
+ eval "${provides}_${f}() { [ '${inner}' = '${mod}_${f}' ] || return 0; ${mod}_${f} \"\$@\"; }"
done
eval module_${mod}_provides="${provides}"
@@ -497,7 +498,8 @@ _load_modules()
eval x=\$module_${mod}_provides
[ -z "${x}" ] && continue
for f in pre_start start post_start; do
- eval "${x}_${f}() { [ "$(command -v "${mod}_${f}")" = "${mod}_${f}" ] || return 0; ${mod}_${f} \"\$@\"; }"
+ inner=$(command -v "${mod}_${f}")
+ eval "${x}_${f}() { [ '${inner}' = '${mod}_${f}' ] || return 0; ${mod}_${f} \"\$@\"; }"
done
eval module_${x}_providedby="${mod}"
;;