dotfiles/scripts/whereami
2022-03-01 18:32:55 +03:00

8 lines
189 B
Bash
Executable File

#!/bin/bash
ip=$(curl "https://api.ipify.org" 2>/dev/null)
res=$(curl -s "http://ip-api.com/json/$ip" 2>/dev/null)
# echo $res | jq '.'
echo $res | jq -r -j '.city, ", ", .country, "\n"'