Skip to content

Instantly share code, notes, and snippets.

@unique1984
Last active August 17, 2019 12:47
Show Gist options
  • Save unique1984/0f987a06ce76b27402cd631c7441b369 to your computer and use it in GitHub Desktop.
Save unique1984/0f987a06ce76b27402cd631c7441b369 to your computer and use it in GitHub Desktop.
What is my IP tool and much more
#!/bin/bash
# chmod +x ip.sh
# ./ip.sh will give your ip and much more
PAGE=$(wget -qO- https://ysnteknoloji.com/geoip/location.php)
tarih=$(echo $PAGE | grep -oP "Tarih\s*:\K([0-9\.\s:]*)")
ip=$(echo $PAGE | grep -oP "IP\s*:\K([0-9\.]*)")
echo -e "Tarih\t\t" $(echo $PAGE | grep -oP "Tarih\s*:\K([0-9\.\s:]*)")
echo -e "IP\t\t" $(echo $PAGE | grep -oP "IP\s*:\K([0-9\.]*)")
echo -e "Enlem\t\t" $(echo $PAGE | grep -oP "Enlem\s*:\K([0-9\.]*)")
echo -e "Boylam\t\t" $(echo $PAGE | grep -oP "Boylam\s*:\K([0-9\.]*)")
echo -e "Ülke Kodu\t" $(echo $PAGE | grep -ioP "Ülke Kodu\s*:\K([a-z]*)")
echo -e "Eyalet\t\t" $(echo $PAGE | grep -ioP "Eyalet\s*:\K([0-9\sa-z]*)")
echo -e "Şehir\t\t" $(echo $PAGE | grep -ioP "Şehir\s*:\K([0-9\sa-z]*)")
unset PAGE
echo -e "$tarih\t$ip" >> ~/.ip_history.log
@unique1984
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment