net-online: fix process of symlinks in sysfs
The test `[ -h "${ifname}" ] && continue` skips the symlinks while it is
the opposite that is the expected: ignoring files that are not symlinks.
Fixes commit f42ec82f21
.
This fixes #391.
This commit is contained in:
parent
5c9c2a1939
commit
bf9af1fb23
@ -23,7 +23,7 @@ get_interfaces()
|
|||||||
{
|
{
|
||||||
local ifname iftype
|
local ifname iftype
|
||||||
for ifname in /sys/class/net/*; do
|
for ifname in /sys/class/net/*; do
|
||||||
[ -h "${ifname}" ] && continue
|
[ -h "${ifname}" ] || continue
|
||||||
read iftype < ${ifname}/type
|
read iftype < ${ifname}/type
|
||||||
[ "$iftype" = "1" ] && printf "%s " ${ifname##*/}
|
[ "$iftype" = "1" ] && printf "%s " ${ifname##*/}
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user