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 390C7139083 for ; Mon, 11 Dec 2017 23:46:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 65EC2E0F83; Mon, 11 Dec 2017 23:46:25 +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 438FFE0F83 for ; Mon, 11 Dec 2017 23:46:24 +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 0046C33BF05 for ; Mon, 11 Dec 2017 23:46:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9DC17AE65 for ; Mon, 11 Dec 2017 23:46:21 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1513035664.ee2524cd1d0305e207f7dfac52742a1d5e77ea4a.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/net-online.in X-VCS-Directories: init.d/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: ee2524cd1d0305e207f7dfac52742a1d5e77ea4a X-VCS-Branch: master Date: Mon, 11 Dec 2017 23:46:21 +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-Archives-Salt: 4d5eb389-9812-4d91-bb63-e32600bf1c5b X-Archives-Hash: 8c65687d00b07a84102d9f6559f681e5 commit: ee2524cd1d0305e207f7dfac52742a1d5e77ea4a Author: William Hubbs gmail com> AuthorDate: Mon Dec 11 23:41:04 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Mon Dec 11 23:41:04 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=ee2524cd net-online: clean up quoting and test for existence This is for #178. init.d/net-online.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/init.d/net-online.in b/init.d/net-online.in index 41910fa0..cd0cb4e2 100644 --- a/init.d/net-online.in +++ b/init.d/net-online.in @@ -44,9 +44,13 @@ start () ifcount=0 for dev in ${interfaces}; do : $((ifcount += 1)) - read carrier < /sys/class/net/$dev/carrier 2> /dev/null - [ $carrier -eq 1 ] && : $((carriers += 1)) - read operstate < /sys/class/net/$dev/operstate 2> /dev/null + carrier= + [ -e /sys/class/net/$dev/carrier ] && + read carrier < /sys/class/net/$dev/carrier + [ "$carrier" = 1 ] && : $((carriers += 1)) + operstate= + [ -e /sys/class/net/$dev/operstate ] && + read operstate < /sys/class/net/$dev/operstate [ "$operstate" = up ] && : $((configured += 1)) done [ $configured -eq $ifcount ] && [ $carriers -ge 1 ] && break