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 87088139083 for ; Tue, 12 Dec 2017 20:24:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DB8B0E0F40; Tue, 12 Dec 2017 20:24:48 +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 BD7E8E0F40 for ; Tue, 12 Dec 2017 20:24:48 +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 1A4AD3418A9 for ; Tue, 12 Dec 2017 20:24:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 598E6AE84 for ; Tue, 12 Dec 2017 20:24:45 +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: <1513110184.8bf501aaf2cb60b8ddf1b2fa2d1ba0ef970fb790.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/network.in X-VCS-Directories: init.d/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 8bf501aaf2cb60b8ddf1b2fa2d1ba0ef970fb790 X-VCS-Branch: master Date: Tue, 12 Dec 2017 20:24:45 +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: 0616ceed-dff3-491e-8864-ace2e8e7155f X-Archives-Hash: 04b1d279f6cc7ca14a85762006e4bf9c commit: 8bf501aaf2cb60b8ddf1b2fa2d1ba0ef970fb790 Author: William Hubbs gmail com> AuthorDate: Tue Dec 12 20:23:04 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Tue Dec 12 20:23:04 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=8bf501aa network: use 'command -v ip' to test for the ip executable This is an improved test because it doesn't require the ip executable to be in a specific path. init.d/network.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.d/network.in b/init.d/network.in index 56d3e7b3..fa9f8de0 100644 --- a/init.d/network.in +++ b/init.d/network.in @@ -76,7 +76,7 @@ tentative() case "$RC_UNAME" in Linux) - [ -x /sbin/ip ] || [ -x /bin/ip ] || return 1 + [ -n "$(command -v ip)" ] || return 1 [ -n "$(ip -f inet6 addr show tentative)" ] ;; *) @@ -174,7 +174,7 @@ runip() routeflush() { if [ "$RC_UNAME" = Linux ]; then - if [ -x /sbin/ip ] || [ -x /bin/ip ]; then + if [ -n "$(command -v ip)" ]; then ip route flush scope global ip route delete default 2>/dev/null else @@ -346,7 +346,7 @@ stop() then veinfo "$int" runargs /etc/ifdown."$int" "$downcmd" - if [ -x /sbin/ip ] || [ -x /bin/ip ]; then + if [ -n "$(command -v ip)" ]; then # We need to do this, otherwise we may # fail to add things correctly on restart ip address flush dev "$int" 2>/dev/null