We are going to be using tnx.nl/ip to get our IP as this just sends the IP in plain format so its easy to read.
Now lets create a script to get our IP.
This tells the shell to use the sh interpreter.
This gets you IP using wget and tnx.nl and stores it in the variable myIP
myIP=`wget -qO- tnx.nl/ip`
This prints out your IP address.
echo "Current IP address is: $myIP"