1 |
commit: c78662eeafaf5f9254f62ae1f40f7c058180af8a |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 21 05:24:46 2019 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 21 05:33:35 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=c78662ee |
7 |
|
8 |
init.d/net.lo.in: shellcheck: _load_modules |
9 |
|
10 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
11 |
|
12 |
init.d/net.lo.in | 14 ++++++++------ |
13 |
1 file changed, 8 insertions(+), 6 deletions(-) |
14 |
|
15 |
diff --git a/init.d/net.lo.in b/init.d/net.lo.in |
16 |
index a958598..c8af39f 100644 |
17 |
--- a/init.d/net.lo.in |
18 |
+++ b/init.d/net.lo.in |
19 |
@@ -430,13 +430,13 @@ _load_modules() |
20 |
fi |
21 |
|
22 |
MODULES= |
23 |
- if [ "${IFACE}" != "lo" -a "${IFACE}" != "lo0" ]; then |
24 |
+ if [ "${IFACE}" != "lo" ] && [ "${IFACE}" != "lo0" ]; then |
25 |
eval mymods=\$modules_${IFVAR} |
26 |
# shellcheck disable=SC2154 |
27 |
[ -z "${mymods}" ] && mymods=${modules} |
28 |
fi |
29 |
|
30 |
- local i=-1 x= mod= f= provides= |
31 |
+ local i=-1 x='' mod='' f='' provides='' |
32 |
while true; do |
33 |
: $(( i += 1 )) |
34 |
eval mod=\$module_${i} |
35 |
@@ -446,7 +446,7 @@ _load_modules() |
36 |
eval set -- \$module_${i}_program |
37 |
if [ -n "$1" ]; then |
38 |
if ! _program_available "$@" >/dev/null; then |
39 |
- vewarn "Skipping module $mod due to missing program: $@" |
40 |
+ vewarn "Skipping module $mod due to missing program: $*" |
41 |
continue |
42 |
fi |
43 |
fi |
44 |
@@ -457,7 +457,7 @@ _load_modules() |
45 |
fi |
46 |
if [ -n "$1" ]; then |
47 |
if ! _program_available "$@" >/dev/null; then |
48 |
- vewarn "Skipping module $mod due to missing program: $@" |
49 |
+ vewarn "Skipping module $mod due to missing program: $*" |
50 |
continue |
51 |
fi |
52 |
fi |
53 |
@@ -483,7 +483,8 @@ _load_modules() |
54 |
# Wrap our provides |
55 |
local f= |
56 |
for f in pre_start start post_start; do |
57 |
- eval "${provides}_${f}() { [ "$(command -v "${mod}_${f}")" = "${mod}_${f}" ] || return 0; ${mod}_${f} \"\$@\"; }" |
58 |
+ inner=$(command -v "${mod}_${f}") |
59 |
+ eval "${provides}_${f}() { [ '${inner}' = '${mod}_${f}' ] || return 0; ${mod}_${f} \"\$@\"; }" |
60 |
done |
61 |
|
62 |
eval module_${mod}_provides="${provides}" |
63 |
@@ -497,7 +498,8 @@ _load_modules() |
64 |
eval x=\$module_${mod}_provides |
65 |
[ -z "${x}" ] && continue |
66 |
for f in pre_start start post_start; do |
67 |
- eval "${x}_${f}() { [ "$(command -v "${mod}_${f}")" = "${mod}_${f}" ] || return 0; ${mod}_${f} \"\$@\"; }" |
68 |
+ inner=$(command -v "${mod}_${f}") |
69 |
+ eval "${x}_${f}() { [ '${inner}' = '${mod}_${f}' ] || return 0; ${mod}_${f} \"\$@\"; }" |
70 |
done |
71 |
eval module_${x}_providedby="${mod}" |
72 |
;; |