fff-network: Add Interfacetype to nodewatcher data

Some monitoring require information about which interface type an interface is.
We may add more interface types in the future.

Signed-off-by: Christian Dresel <freifunk@dresel.systems>
This commit is contained in:
Christian Dresel 2022-04-10 08:28:15 +02:00
parent 57408f5dfb
commit ffe4d43b8a
1 changed files with 3 additions and 0 deletions

View File

@ -63,6 +63,9 @@ for filename in $(grep 'up\|unknown' /sys/class/net/*/operstate); do
/width/{ split($0, w, ": "); sub(/ .*/, "", w[2]); printf "<wlan_width>"w[2]"</wlan_width>" }
')
#Add Interfacetype (e.g. wireguard, fastd, vxlan, ether, etc) to nodewatcher data
wg show "${iface}" &> /dev/null && interface_data=$interface_data"<type>wireguard</type>"
interface_data=$interface_data"</$iface>"
done