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