From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-1084799-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 9E7CA138334 for <garchives@archives.gentoo.org>; Sun, 21 Apr 2019 05:34:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E2C2FE0AE0; Sun, 21 Apr 2019 05:34:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 A3F52E0ADF for <gentoo-commits@lists.gentoo.org>; Sun, 21 Apr 2019 05:34:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 A0348341BBE for <gentoo-commits@lists.gentoo.org>; Sun, 21 Apr 2019 05:34:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A668F5CB for <gentoo-commits@lists.gentoo.org>; Sun, 21 Apr 2019 05:34:03 +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: <1555824816.b8ea3b8f78cb91cd48661ba81f3e261c5ff12f44.robbat2@OpenRC> Subject: [gentoo-commits] proj/netifrc:master commit in: init.d/ X-VCS-Repository: proj/netifrc X-VCS-Files: init.d/net.lo.in X-VCS-Directories: init.d/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: b8ea3b8f78cb91cd48661ba81f3e261c5ff12f44 X-VCS-Branch: master Date: Sun, 21 Apr 2019 05:34:03 +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: 802f6fba-bdaa-4921-bb69-0fd2a63f6a59 X-Archives-Hash: bfb8c3ea6e2bea528936590c34c268be commit: b8ea3b8f78cb91cd48661ba81f3e261c5ff12f44 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> AuthorDate: Sun Apr 21 05:25:29 2019 +0000 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> CommitDate: Sun Apr 21 05:33:36 2019 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=b8ea3b8f init.d/net.lo.in: shellcheck: _load_config Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> init.d/net.lo.in | 9 +++++---- 1 file 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