1 |
commit: b8ea3b8f78cb91cd48661ba81f3e261c5ff12f44 |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 21 05:25:29 2019 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 21 05:33:36 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=b8ea3b8f |
7 |
|
8 |
init.d/net.lo.in: shellcheck: _load_config |
9 |
|
10 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
11 |
|
12 |
init.d/net.lo.in | 9 +++++---- |
13 |
1 file changed, 5 insertions(+), 4 deletions(-) |
14 |
|
15 |
diff --git a/init.d/net.lo.in b/init.d/net.lo.in |
16 |
index c8af39f..30ab7fd 100644 |
17 |
--- a/init.d/net.lo.in |
18 |
+++ b/init.d/net.lo.in |
19 |
@@ -530,8 +530,9 @@ _load_modules() |
20 |
|
21 |
_load_config() |
22 |
{ |
23 |
- local config="$(_get_array "config_${IFVAR}")" |
24 |
- local fallback="$(_get_array fallback_${IFVAR})" |
25 |
+ local config='' fallback='' |
26 |
+ config="$(_get_array "config_${IFVAR}")" |
27 |
+ fallback="$(_get_array fallback_${IFVAR})" |
28 |
|
29 |
config_index=0 |
30 |
local IFS="$__IFS" |
31 |
@@ -545,7 +546,7 @@ _load_config() |
32 |
# Of course, we may have a single address added old style. |
33 |
# If the NEXT argument is a v4 or v6 address, it's the next config. |
34 |
# Otherwise, it's arguments to the first config... |
35 |
- if [ "${2#*.*}" = "${2}" -a "${2#*:*}" = "${2}" ]; then |
36 |
+ if [ "${2#*.*}" = "${2}" ] && [ "${2#*:*}" = "${2}" ]; then |
37 |
# Not an IPv4/IPv6 |
38 |
local IFS="$__IFS" |
39 |
set -- ${config} |
40 |
@@ -553,7 +554,7 @@ _load_config() |
41 |
fi |
42 |
|
43 |
# Ensure that loopback has the correct address |
44 |
- if [ "${IFACE}" = "lo" -o "${IFACE}" = "lo0" ]; then |
45 |
+ if [ "${IFACE}" = "lo" ] || [ "${IFACE}" = "lo0" ]; then |
46 |
if [ "$1" != "null" ]; then |
47 |
config_0="127.0.0.1/8" |
48 |
config_index=1 |