+chmod
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
parent
46991d297d
commit
629a3c4a9f
1 changed files with 4 additions and 0 deletions
4
get-country-from-vpn-connections.sh
Normal file → Executable file
4
get-country-from-vpn-connections.sh
Normal file → Executable file
|
@ -2,6 +2,10 @@
|
||||||
# 2019-09-09, Nico Schottelius
|
# 2019-09-09, Nico Schottelius
|
||||||
# Show countries / region of VPN clients connected with wireguard
|
# Show countries / region of VPN clients connected with wireguard
|
||||||
|
|
||||||
|
# countries + region
|
||||||
for ip in $(wg | grep endpoint | sed -e 's/endpoint: //' -e 's/\(.*\):[0-9]*/\1/' -e 's/\[//' -e 's/\]//'); do
|
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 -e region;
|
curl -s ipinfo.io/$ip | grep -e country -e region;
|
||||||
done
|
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
|
||||||
|
|
Loading…
Reference in a new issue