1 |
commit: ee2524cd1d0305e207f7dfac52742a1d5e77ea4a |
2 |
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon Dec 11 23:41:04 2017 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 11 23:41:04 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=ee2524cd |
7 |
|
8 |
net-online: clean up quoting and test for existence |
9 |
|
10 |
This is for #178. |
11 |
|
12 |
init.d/net-online.in | 10 +++++++--- |
13 |
1 file changed, 7 insertions(+), 3 deletions(-) |
14 |
|
15 |
diff --git a/init.d/net-online.in b/init.d/net-online.in |
16 |
index 41910fa0..cd0cb4e2 100644 |
17 |
--- a/init.d/net-online.in |
18 |
+++ b/init.d/net-online.in |
19 |
@@ -44,9 +44,13 @@ start () |
20 |
ifcount=0 |
21 |
for dev in ${interfaces}; do |
22 |
: $((ifcount += 1)) |
23 |
- read carrier < /sys/class/net/$dev/carrier 2> /dev/null |
24 |
- [ $carrier -eq 1 ] && : $((carriers += 1)) |
25 |
- read operstate < /sys/class/net/$dev/operstate 2> /dev/null |
26 |
+ carrier= |
27 |
+ [ -e /sys/class/net/$dev/carrier ] && |
28 |
+ read carrier < /sys/class/net/$dev/carrier |
29 |
+ [ "$carrier" = 1 ] && : $((carriers += 1)) |
30 |
+ operstate= |
31 |
+ [ -e /sys/class/net/$dev/operstate ] && |
32 |
+ read operstate < /sys/class/net/$dev/operstate |
33 |
[ "$operstate" = up ] && : $((configured += 1)) |
34 |
done |
35 |
[ $configured -eq $ifcount ] && [ $carriers -ge 1 ] && break |