From 629a3c4a9fc7493e651f46c60cbfbec2a75eee3e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 9 Sep 2019 22:58:05 +0900 Subject: [PATCH] +chmod Signed-off-by: Nico Schottelius --- get-country-from-vpn-connections.sh | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 get-country-from-vpn-connections.sh diff --git a/get-country-from-vpn-connections.sh b/get-country-from-vpn-connections.sh old mode 100644 new mode 100755 index 5b5e59d..a1e7960 --- a/get-country-from-vpn-connections.sh +++ b/get-country-from-vpn-connections.sh @@ -2,6 +2,10 @@ # 2019-09-09, Nico Schottelius # 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 curl -s ipinfo.io/$ip | grep -e country -e region; 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