dotfiles/scripts/whereami

8 lines
189 B
Plaintext
Raw Normal View History

2022-03-01 14:07:01 +01:00
#!/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"'