1 |
commit: f2e404ab66b2c7eb22de4f9d01a444225b1ff616 |
2 |
Author: William Hubbs <williamh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 7 19:09:17 2012 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 7 19:09:17 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=f2e404ab |
7 |
|
8 |
net.lo: Add the ability to find the full path of a binary |
9 |
|
10 |
Some of the networking tools, such as iproute2, can be stored in one of |
11 |
several locations. This function gives us a standard way to find these |
12 |
tools. |
13 |
|
14 |
I would like to thankRobin Johnson <robbat2 <AT> gentoo.org> for his input on |
15 |
this function. |
16 |
|
17 |
--- |
18 |
init.d/net.lo.in | 12 ++++++++++++ |
19 |
1 files changed, 12 insertions(+), 0 deletions(-) |
20 |
|
21 |
diff --git a/init.d/net.lo.in b/init.d/net.lo.in |
22 |
index 0752400..de393bd 100644 |
23 |
--- a/init.d/net.lo.in |
24 |
+++ b/init.d/net.lo.in |
25 |
@@ -169,6 +169,18 @@ _configure_variables() |
26 |
done |
27 |
} |
28 |
|
29 |
+_which() |
30 |
+{ |
31 |
+ local i OIFS |
32 |
+ [ -z "$1" ] && return |
33 |
+ OIFS="$IFS" |
34 |
+ IFS=: |
35 |
+ for i in $PATH ; do |
36 |
+ [ -x $i/$1 ] && echo $i/$1 && break |
37 |
+ done |
38 |
+ IFS=$OIFS |
39 |
+} |
40 |
+ |
41 |
_show_address() |
42 |
{ |
43 |
einfo "received address $(_get_inet_address "${IFACE}")" |