From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1084787-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 82C59138336
	for <garchives@archives.gentoo.org>; Sun, 21 Apr 2019 05:34:06 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 9DE8EE0AC5;
	Sun, 21 Apr 2019 05:34:05 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 8798FE0AC5
	for <gentoo-commits@lists.gentoo.org>; Sun, 21 Apr 2019 05:34:05 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 2A7F9341BBC
	for <gentoo-commits@lists.gentoo.org>; Sun, 21 Apr 2019 05:34:04 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id B866E5BC
	for <gentoo-commits@lists.gentoo.org>; Sun, 21 Apr 2019 05:34:02 +0000 (UTC)
From: "Robin H. Johnson" <robbat2@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" <robbat2@gentoo.org>
Message-ID: <1555823845.b862d25a8ad39d79fdb4564447f1bb8cd33cb6bf.robbat2@OpenRC>
Subject: [gentoo-commits] proj/netifrc:master commit in: sh/
X-VCS-Repository: proj/netifrc
X-VCS-Files: sh/udhcpc-hook.sh.in
X-VCS-Directories: sh/
X-VCS-Committer: robbat2
X-VCS-Committer-Name: Robin H. Johnson
X-VCS-Revision: b862d25a8ad39d79fdb4564447f1bb8cd33cb6bf
X-VCS-Branch: master
Date: Sun, 21 Apr 2019 05:34:02 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 4f9e32cb-4a61-4917-9bce-9b980ba85ed0
X-Archives-Hash: c8bcb587ab0f150b9f0ec0ca9f28002a

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