From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RjcBD-0003Z6-AA for garchives@archives.gentoo.org; Sat, 07 Jan 2012 19:43:58 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 71A98E04AB; Sat, 7 Jan 2012 19:43:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 41DA3E050F for ; Sat, 7 Jan 2012 19:43:43 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8FE9C1B4015 for ; Sat, 7 Jan 2012 19:43:42 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id D516D80042 for ; Sat, 7 Jan 2012 19:43:41 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/net.lo.in X-VCS-Directories: init.d/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: f2e404ab66b2c7eb22de4f9d01a444225b1ff616 Date: Sat, 7 Jan 2012 19:43:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: ac2a0967-6d97-4215-93b7-4a5aa7bcd8fc X-Archives-Hash: df38ab6cb4822efe28b8c90d69805ed7 commit: f2e404ab66b2c7eb22de4f9d01a444225b1ff616 Author: William Hubbs gentoo org> AuthorDate: Sat Jan 7 19:09:17 2012 +0000 Commit: William Hubbs gentoo org> CommitDate: Sat Jan 7 19:09:17 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3Df2e404ab net.lo: Add the ability to find the full path of a binary Some of the networking tools, such as iproute2, can be stored in one of several locations. This function gives us a standard way to find these tools. I would like to thankRobin Johnson gentoo.org> for his inpu= t on this function. --- init.d/net.lo.in | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/init.d/net.lo.in b/init.d/net.lo.in index 0752400..de393bd 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -169,6 +169,18 @@ _configure_variables() done } =20 +_which() +{ + local i OIFS + [ -z "$1" ] && return + OIFS=3D"$IFS" + IFS=3D: + for i in $PATH ; do + [ -x $i/$1 ] && echo $i/$1 && break + done + IFS=3D$OIFS +} + _show_address() { einfo "received address $(_get_inet_address "${IFACE}")"