aboutsummaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2012-01-07 13:09:17 -0600
committerWilliam Hubbs <williamh@gentoo.org>2012-01-07 13:09:17 -0600
commitf2e404ab66b2c7eb22de4f9d01a444225b1ff616 (patch)
tree06d526c7732df1f8d6ae22d7e43542b6da43af4b /init.d
parentadde73141f67f7772ba1efcd8820f63ff2a45374 (diff)
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 <robbat2@gentoo.org> for his input on this function.
Diffstat (limited to 'init.d')
-rw-r--r--init.d/net.lo.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/init.d/net.lo.in b/init.d/net.lo.in
index 07524002..de393bd1 100644
--- a/init.d/net.lo.in
+++ b/init.d/net.lo.in
@@ -169,6 +169,18 @@ _configure_variables()
done
}
+_which()
+{
+ local i OIFS
+ [ -z "$1" ] && return
+ OIFS="$IFS"
+ IFS=:
+ for i in $PATH ; do
+ [ -x $i/$1 ] && echo $i/$1 && break
+ done
+ IFS=$OIFS
+}
+
_show_address()
{
einfo "received address $(_get_inet_address "${IFACE}")"