From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 7D66E138334 for ; Sun, 21 Apr 2019 05:34:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0B720E0AE3; Sun, 21 Apr 2019 05:34:09 +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 D1E74E0AE3 for ; Sun, 21 Apr 2019 05:34:08 +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 8D3D3341BBA for ; Sun, 21 Apr 2019 05:34:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CFD6D5CD for ; Sun, 21 Apr 2019 05:34:03 +0000 (UTC) From: "Robin H. Johnson" 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" Message-ID: <1555824820.1ae3f8e257032e753713b6582e23121984c0f9fa.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: 1ae3f8e257032e753713b6582e23121984c0f9fa X-VCS-Branch: master Date: Sun, 21 Apr 2019 05:34:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0cbd4194-aba2-49f4-93bf-49457dc51698 X-Archives-Hash: 6b4cf3c53afcb95bcf4c83fa1e45d52f commit: 1ae3f8e257032e753713b6582e23121984c0f9fa Author: Robin H. Johnson gentoo org> AuthorDate: Sun Apr 21 05:28:15 2019 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Sun Apr 21 05:33:40 2019 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=1ae3f8e2 init.d/net.lo.in: shellcheck: start() Signed-off-by: Robin H. Johnson gentoo.org> init.d/net.lo.in | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/init.d/net.lo.in b/init.d/net.lo.in index e1a0cab..9ba2e03 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -632,9 +632,17 @@ is_interface_type() start() { - local IFACE=$(get_interface) oneworked=false fallback=false module= - local IFVAR=$(shell_var "${IFACE}") cmd= our_metric= - local metric=0 _up_before_preup + local IFACE='' + local IFVAR='' + local oneworked=false + local fallback=false + local module='' + local cmd='' + local our_metric='' + local metric=0 + local _up_before_preup='' + IFACE=$(get_interface) + IFVAR=$(shell_var "${IFACE}") eval _up_before_preup="\$up_before_preup_${IFVAR}" # shellcheck disable=SC2154 [ -z "${_up_before_preup}" ] && _up_before_preup=$up_before_preup @@ -682,14 +690,14 @@ start() return 1 fi - local config= config_index= + local config='' config_index='' _load_config config_index=0 eval our_metric=\$metric_${IFVAR} if [ -n "${our_metric}" ]; then metric=${our_metric} - elif [ "${IFACE}" != "lo" -a "${IFACE}" != "lo0" ]; then + elif [ "${IFACE}" != "lo" ] && [ "${IFACE}" != "lo0" ]; then : $(( metric += $(_ifindex) )) fi @@ -698,7 +706,7 @@ start() [ -z "${config}" ] && break set -- ${config} - if [ "$1" != "null" -a "$1" != "noop" ]; then + if [ "$1" != "null" ] && [ "$1" != "noop" ]; then ebegin "$1" fi eindent @@ -754,7 +762,7 @@ start() if [ -z "${routes}" ]; then routes="$(_get_array "routes_${IFVAR}")" fi - if [ "${IFACE}" = "lo" -o "${IFACE}" = "lo0" ]; then + if [ "${IFACE}" = "lo" ] || [ "${IFACE}" = "lo0" ]; then if [ "${config_0}" != "null" ]; then routes="127.0.0.0/8 via 127.0.0.1 ${routes}" @@ -780,11 +788,11 @@ ${routes}" ebegin ${cmd} # Work out if we're a host or a net if not told case ${cmd} in - -net" "*|-host" "*);; - *" "netmask" "*) cmd="-net ${cmd}";; + -net\ *|-host\ *);; + *\ netmask\ *) cmd="-net ${cmd}";; *.*.*.*/32*) cmd="-host ${cmd}";; - *.*.*.*/*|0.0.0.0|0.0.0.0" "*) cmd="-net ${cmd}";; - default|default" "*) cmd="-net ${cmd}";; + *.*.*.*/*|0.0.0.0|0.0.0.0\ *) cmd="-net ${cmd}";; + default|default\ *) cmd="-net ${cmd}";; *:*/128*) cmd="-host ${cmd}";; *:*/*) cmd="-net ${cmd}";; *) cmd="-host ${cmd}";;