1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

chore: fix git stash issue

This commit is contained in:
pimlie 2025-04-19 16:17:26 +02:00
parent 4b56760a80
commit ec5debb582

View file

@ -99,20 +99,6 @@ function wg_peers {
local -n _wg_peers=$1 local -n _wg_peers=$1
local iface=$2 local iface=$2
<<<<<<< Updated upstream
# From wg 8 manpage:
# If dump is specified, then several lines are printed; the first contains
# in order separated by tab: private-key, public-key, listen-port, fwmark.
# 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 | 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
continue
fi
=======
if [ -z "${_CACHE_PEERS[$iface]}" ]; then if [ -z "${_CACHE_PEERS[$iface]}" ]; then
# From wg 8 manpage: # From wg 8 manpage:
# If dump is specified, then several lines are printed; the first contains # If dump is specified, then several lines are printed; the first contains
@ -123,7 +109,6 @@ function wg_peers {
# Pipe to tail to skip first line # Pipe to tail to skip first line
_CACHE_PEERS["$iface"]="$(wg show "$iface" dump | tail -n +2)" _CACHE_PEERS["$iface"]="$(wg show "$iface" dump | tail -n +2)"
fi fi
>>>>>>> Stashed changes
readarray -t peers <<< "${_CACHE_PEERS[$iface]}" readarray -t peers <<< "${_CACHE_PEERS[$iface]}"
_wg_peers=("${peers[@]}") _wg_peers=("${peers[@]}")