aboutsummaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2019-04-20 22:21:51 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2019-04-20 22:31:06 -0700
commitd2d52cd821372c65b92d262da66a30794735204c (patch)
tree95f30fbbccc59deea22dca4b924698979a94ecad /init.d
parentinit.d/net.lo.in: shellcheck: _gen_module_list(), _load_modules() (diff)
downloadnetifrc-d2d52cd821372c65b92d262da66a30794735204c.tar.gz
netifrc-d2d52cd821372c65b92d262da66a30794735204c.tar.bz2
netifrc-d2d52cd821372c65b92d262da66a30794735204c.zip
init.d/net.lo.in: shellcheck: disable some false positives
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'init.d')
-rw-r--r--init.d/net.lo.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/init.d/net.lo.in b/init.d/net.lo.in
index d9a4d24..1e5de3c 100644
--- a/init.d/net.lo.in
+++ b/init.d/net.lo.in
@@ -83,6 +83,7 @@ _get_array()
{
local _a=
if [ -n "${BASH}" ]; then
+ # shellcheck disable=SC2039
case "$(declare -p "$1" 2>/dev/null)" in
"declare -a "*)
ewarn "You are using a bash array for $1."
@@ -104,6 +105,7 @@ _get_array()
_flatten_array()
{
if [ -n "${BASH}" ]; then
+ # shellcheck disable=SC2039
case "$(declare -p "$1" 2>/dev/null)" in
"declare -a "*)
ewarn "You are using a bash array for $1."
@@ -111,6 +113,7 @@ _flatten_array()
ewarn "Please see net.example for the correct format for $1."
eval "set -- \"\${$1[@]}\""
for x; do
+ # shellcheck disable=SC2059
printf "'%s' " "$(printf "$x" | sed "s:':'\\\'':g")"
done
return 0
@@ -194,6 +197,7 @@ _netmask2cidr()
quad=${quad}${quad:+.}0x${hex%${lastbut2}*}
hex=${lastbut2}
done
+ # shellcheck disable=SC2086
set -- ${quad}
;;
esac
@@ -427,6 +431,7 @@ _load_modules()
MODULES=
if [ "${IFACE}" != "lo" -a "${IFACE}" != "lo0" ]; then
eval mymods=\$modules_${IFVAR}
+ # shellcheck disable=SC2154
[ -z "${mymods}" ] && mymods=${modules}
fi
@@ -627,6 +632,7 @@ start()
local IFVAR=$(shell_var "${IFACE}") cmd= our_metric=
local metric=0 _up_before_preup
eval _up_before_preup="\$up_before_preup_${IFVAR}"
+ # shellcheck disable=SC2154
[ -z "${_up_before_preup}" ] && _up_before_preup=$up_before_preup
einfo "Bringing up interface ${IFACE}"