Bash script to fetch IP address information.
To obtain information, a request will be sent to ipinfo.io
~ > myip
┌─────────────────────────────┐
│ IP Information │
└─────────────────────────────┘
IP: 123.456.78.90
Hostname: null
City: CityName
Region: Region Name
Country: RN (12.3456,7.8910)
Postal Code: 1122
Organization: Organization Name.- Install Dependencies
sudo apt install jq curl- Download the script:
curl -O https://raw.githubusercontent.com/imtoopunkforyou/myip/refs/heads/main/myip.sh- Make executable:
chmod +x myip.sh- Simply run:
./myip.shAdd to your shell configuration (.bashrc/.zshrc):
alias myip="/path/to/myip.sh"