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:
parent
7affff568a
commit
f42ec82f21
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user