1 |
commit: 61e05331d14a08fa909526fda15470a1ca4927dd |
2 |
Author: William Hubbs <williamh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 7 21:41:43 2012 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 7 21:41:43 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=61e05331 |
7 |
|
8 |
net: make lookup of iproute2 dynamic |
9 |
|
10 |
The iproute2, macvlan and vlan modules had several possible hard coded |
11 |
paths for the iproute2 binary. Now we look for it in the path. |
12 |
|
13 |
--- |
14 |
net/iproute2.sh | 14 ++++---------- |
15 |
net/macvlan.sh | 14 ++++---------- |
16 |
net/vlan.sh | 14 ++++---------- |
17 |
3 files changed, 12 insertions(+), 30 deletions(-) |
18 |
|
19 |
diff --git a/net/iproute2.sh b/net/iproute2.sh |
20 |
index bb52e98..16d9a60 100644 |
21 |
--- a/net/iproute2.sh |
22 |
+++ b/net/iproute2.sh |
23 |
@@ -1,18 +1,12 @@ |
24 |
# Copyright (c) 2007-2008 Roy Marples <roy@×××××××.name> |
25 |
# Released under the 2-clause BSD license. |
26 |
|
27 |
-_ip() |
28 |
-{ |
29 |
- if [ -x /bin/ip ]; then |
30 |
- echo /bin/ip |
31 |
- else |
32 |
- echo /sbin/ip |
33 |
- fi |
34 |
-} |
35 |
- |
36 |
iproute2_depend() |
37 |
{ |
38 |
- program $(_ip) |
39 |
+ local x |
40 |
+ x=$(_which ip) |
41 |
+ [ -z "$x" ] && return 1 |
42 |
+ program $x |
43 |
provide interface |
44 |
after ifconfig |
45 |
} |
46 |
|
47 |
diff --git a/net/macvlan.sh b/net/macvlan.sh |
48 |
index 422268e..ccb28ea 100644 |
49 |
--- a/net/macvlan.sh |
50 |
+++ b/net/macvlan.sh |
51 |
@@ -3,18 +3,12 @@ |
52 |
# Copyright (c) 2007-2008 Roy Marples <roy@×××××××.name> |
53 |
# All rights reserved. Released under the 2-clause BSD license. |
54 |
|
55 |
-_ip() |
56 |
-{ |
57 |
- if [ -x /bin/ip ]; then |
58 |
- echo /bin/ip |
59 |
- else |
60 |
- echo /sbin/ip |
61 |
- fi |
62 |
-} |
63 |
- |
64 |
macvlan_depend() |
65 |
{ |
66 |
- program $(_ip) |
67 |
+ local x |
68 |
+ x=$(_which ip) |
69 |
+ [ -z "${X}" ] && return 1 |
70 |
+ program $x |
71 |
after interface |
72 |
before dhcp macchanger |
73 |
} |
74 |
|
75 |
diff --git a/net/vlan.sh b/net/vlan.sh |
76 |
index 960cd09..ec30dd6 100644 |
77 |
--- a/net/vlan.sh |
78 |
+++ b/net/vlan.sh |
79 |
@@ -1,18 +1,12 @@ |
80 |
# Copyright (c) 2007-2008 Roy Marples <roy@×××××××.name> |
81 |
# Released under the 2-clause BSD license. |
82 |
|
83 |
-_ip() |
84 |
-{ |
85 |
- if [ -x /bin/ip ]; then |
86 |
- echo /bin/ip |
87 |
- else |
88 |
- echo /sbin/ip |
89 |
- fi |
90 |
-} |
91 |
- |
92 |
vlan_depend() |
93 |
{ |
94 |
- program $(_ip) |
95 |
+ local x |
96 |
+ x=$(_which ip) |
97 |
+ [ -z "$x" ] && return 1 |
98 |
+ program $x |
99 |
after interface |
100 |
before dhcp |
101 |
} |