1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 10:39:53 +00:00

Merge pull request #1487 from droscy/fix/wireguard/none

[wireguard_] Prevent never-connected peers to be shown as "(none)"
This commit is contained in:
Kenyon Ralph 2025-03-22 01:40:32 -07:00 committed by GitHub
commit 0016cfdfa6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,7 +80,7 @@ function wg_peers {
# Subsequent lines are printed for each peer and contain in order separated
# by tab: public-key, preshared-key, endpoint, allowed-ips, latest-handshake,
# transfer-rx, transfer-tx, persistent-keepalive
for line in $(wg show "$iface" dump | tr '\t' ';'); do
for line in $(wg show "$iface" dump | grep -v none | tr '\t' ';'); do
column_count=$(awk -F';' '{print NF}' <<< "$line")
if [ "$column_count" -ne 8 ]; then
# First line of dump contains interface info, ignore this line