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:
Gaël PORTAY 2020-12-13 12:00:39 -05:00 committed by William Hubbs
parent 5c9c2a1939
commit bf9af1fb23

View File

@ -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