[vpn stats] added number of configured/active VPNs

This commit is contained in:
Nico Schottelius 2019-12-26 12:16:38 +01:00
parent c2b88832a5
commit 5c66bbb619

View file

@ -9,3 +9,10 @@ done
# countries with counter
( for ip in $(wg | grep endpoint | sed -e 's/endpoint: //' -e 's/\(.*\):[0-9]*/\1/' -e 's/\[//' -e 's/\]//'); do curl -s ipinfo.io/$ip | grep -e country ; done ) | sort | uniq -c | sort -g
# Get number of configured VPNs
configured_vpns=$(wg show | grep ^peer | wc -l)
active_vpns=$(wg show | grep endpoint | wc -l)
echo "Configured VPNs: ${configured_vpns}"
echo "Active VPNs: ${active_vpns}"