[vpn stats] added number of configured/active VPNs
This commit is contained in:
parent
c2b88832a5
commit
5c66bbb619
1 changed files with 7 additions and 0 deletions
|
@ -9,3 +9,10 @@ done
|
||||||
|
|
||||||
# countries with counter
|
# 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
|
( 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}"
|
||||||
|
|
Loading…
Reference in a new issue