From 46991d297d7502bccaa249e2eb4f96af0c610083 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 9 Sep 2019 22:06:45 +0900 Subject: [PATCH] Add script to get country and region from wireguard connections --- get-country-from-vpn-connections.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 get-country-from-vpn-connections.sh diff --git a/get-country-from-vpn-connections.sh b/get-country-from-vpn-connections.sh new file mode 100644 index 0000000..5b5e59d --- /dev/null +++ b/get-country-from-vpn-connections.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# 2019-09-09, Nico Schottelius +# Show countries / region of VPN clients connected with wireguard + +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