Do not use file tests in net-online
https://unix.stackexchange.com/questions/252002/help-testing-special-file-in-sys-class-net This is for #189
This commit is contained in:
parent
ee2524cd1d
commit
9d05f68b51
@ -44,13 +44,11 @@ start ()
|
|||||||
ifcount=0
|
ifcount=0
|
||||||
for dev in ${interfaces}; do
|
for dev in ${interfaces}; do
|
||||||
: $((ifcount += 1))
|
: $((ifcount += 1))
|
||||||
|
read carrier < /sys/class/net/$dev/carrier 2> /dev/null ||
|
||||||
carrier=
|
carrier=
|
||||||
[ -e /sys/class/net/$dev/carrier ] &&
|
|
||||||
read carrier < /sys/class/net/$dev/carrier
|
|
||||||
[ "$carrier" = 1 ] && : $((carriers += 1))
|
[ "$carrier" = 1 ] && : $((carriers += 1))
|
||||||
|
read operstate < /sys/class/net/$dev/operstate 2> /dev/null ||
|
||||||
operstate=
|
operstate=
|
||||||
[ -e /sys/class/net/$dev/operstate ] &&
|
|
||||||
read operstate < /sys/class/net/$dev/operstate
|
|
||||||
[ "$operstate" = up ] && : $((configured += 1))
|
[ "$operstate" = up ] && : $((configured += 1))
|
||||||
done
|
done
|
||||||
[ $configured -eq $ifcount ] && [ $carriers -ge 1 ] && break
|
[ $configured -eq $ifcount ] && [ $carriers -ge 1 ] && break
|
||||||
|
Loading…
Reference in New Issue
Block a user