From: "Robin H. Johnson" <robbat2@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/netifrc:master commit in: sh/
Date: Sun, 21 Apr 2019 05:34:02 +0000 (UTC) [thread overview]
Message-ID: <1555823845.b862d25a8ad39d79fdb4564447f1bb8cd33cb6bf.robbat2@OpenRC> (raw)
commit: b862d25a8ad39d79fdb4564447f1bb8cd33cb6bf
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 21 05:17:25 2019 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Apr 21 05:17:25 2019 +0000
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=b862d25a
sh/udhcpc-hook.sh: shellcheck fixes
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
sh/udhcpc-hook.sh.in | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sh/udhcpc-hook.sh.in b/sh/udhcpc-hook.sh.in
index 13ea336..e4300c1 100644
--- a/sh/udhcpc-hook.sh.in
+++ b/sh/udhcpc-hook.sh.in
@@ -68,7 +68,7 @@ update_classless_routes()
max_routes=128
metric=
[ -n "${IF_METRIC}" ] && metric="metric ${IF_METRIC}"
- while [ -n "$1" -a -n "$2" -a $max_routes -gt 0 ]; do
+ while [ -n "$1" ] && [ -n "$2" ] && [ $max_routes -gt 0 ]; do
gw_arg=
if [ "$2" != '0.0.0.0' ]; then
gw_arg="gw $2"
@@ -76,7 +76,7 @@ update_classless_routes()
[ ${1##*/} -eq 32 ] && type=host || type=net
route add -$type "$1" ${gw_arg} ${metric} dev "${interface}"
- max=$(($max-1))
+ max=$((max-1))
shift 2
done
fi
@@ -90,7 +90,7 @@ update_routes()
# If the DHCP server returns both a Classless Static Routes option and
# a Router option, the DHCP client MUST ignore the Router option.
- if [ -n "${router}" -a -z "${staticroutes}" ] ; then
+ if [ -n "${router}" ] && [ -z "${staticroutes}" ] ; then
metric=
[ -n "${IF_METRIC}" ] && metric="metric ${IF_METRIC}"
for i in ${router} ; do
@@ -115,6 +115,7 @@ deconfig()
}
if [ -r "/run/udhcpc-${interface}.conf" ]; then
+ # shellcheck disable=SC1090
. "/run/udhcpc-${interface}.conf"
fi
next reply other threads:[~2019-04-21 5:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-21 5:34 Robin H. Johnson [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-03-25 0:45 [gentoo-commits] proj/netifrc:master commit in: sh/ Patrick McLean
2019-04-21 4:17 Robin H. Johnson
2016-10-24 22:26 Robin H. Johnson
2016-07-19 19:59 Robin H. Johnson
2015-01-22 23:01 Robin H. Johnson
2015-01-16 18:16 Robin H. Johnson
2015-01-16 18:16 Robin H. Johnson
2015-01-09 17:17 Robin H. Johnson
2015-01-09 17:17 Robin H. Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1555823845.b862d25a8ad39d79fdb4564447f1bb8cd33cb6bf.robbat2@OpenRC \
--to=robbat2@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox