ungleich-tools/get-country-from-vpn-connections.sh

8 lines
279 B
Bash
Raw Normal View History

#!/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