Skip to content

Instantly share code, notes, and snippets.

@graham
Created February 24, 2020 19:41
Show Gist options
  • Save graham/3fd8bef3d4b3815d046c3c02f4cf27bc to your computer and use it in GitHub Desktop.
Save graham/3fd8bef3d4b3815d046c3c02f4cf27bc to your computer and use it in GitHub Desktop.
IP=`curl -s https://www.IPChicken.com | egrep -iEo "([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)" | head -n 1`
if [[ "$IP" = "10.0.0.1" ]];
then
echo -e "IP IS THE SAME $IP"
else
echo -e "\e[31m IP IS NOW $IP WHICH IS DIFFERENT \e[0m"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment