Created
August 12, 2020 12:59
-
-
Save rojenzaman/7296287eaee1fff19f9b48395ba94140 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -s ifconfig.co/json | jq -r "[.ip,.country,.city,.time_zone,.region_name,.asn,.asn_org,.hostname] | @tsv" > .tmp | |
while IFS=" " read -r ip country city time_zone region_name asn asn_org hostname; do | |
cat <<EOF | |
IP : $ip | |
Country : $country | |
City : $city | |
Time Zone : $time_zone | |
Region Name : $region_name | |
ASN : $asn | |
ASN Organization : $asn_org | |
Hostname : $hostname | |
EOF | |
done < .tmp && rm .tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment