diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2019-04-20 22:25:29 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2019-04-20 22:33:36 -0700 |
commit | b8ea3b8f78cb91cd48661ba81f3e261c5ff12f44 (patch) | |
tree | d252efd929b3c3183c08f4884044908441f1e28f /init.d | |
parent | init.d/net.lo.in: shellcheck: _load_modules (diff) | |
download | netifrc-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>
Diffstat (limited to 'init.d')
-rw-r--r-- | init.d/net.lo.in | 9 |
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 |