net-online: only process symbolic links in /sys/class/net

The /sys/class/net directory contains files which are not symlinks if
the system has bonded devices [1].  We should ignore these files.

This fixes #196.

[1] https://elkano.org/blog/manage-interface-bondings-sysfs-interface/
This commit is contained in:
3PO 2017-12-31 22:50:57 +01:00 committed by William Hubbs
parent 7affff568a
commit f42ec82f21

View File

@ -23,6 +23,7 @@ get_interfaces()
{
local ifname iftype
for ifname in /sys/class/net/*; do
[ -h "${ifname}" ] && continue
read iftype < ${ifname}/type
[ "$iftype" = "1" ] && printf "%s " ${ifname##*/}
done