aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2019-04-20 22:25:29 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2019-04-20 22:33:36 -0700
commitb8ea3b8f78cb91cd48661ba81f3e261c5ff12f44 (patch)
treed252efd929b3c3183c08f4884044908441f1e28f
parentinit.d/net.lo.in: shellcheck: _load_modules (diff)
downloadnetifrc-b8ea3b8f78cb91cd48661ba81f3e261c5ff12f44.tar.gz
netifrc-b8ea3b8f78cb91cd48661ba81f3e261c5ff12f44.tar.bz2
netifrc-b8ea3b8f78cb91cd48661ba81f3e261c5ff12f44.zip
init.d/net.lo.in: shellcheck: _load_config
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--init.d/net.lo.in9
1 files 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