For this, you need the packages wget, grep and sed so make sure you have them by checking for them in Synaptic or running the following in a terminal
sudo apt-get install wget grep sed
Then, as long as whatismyip.com prints out the IP-Address in the HTML page title, you can use this.
Create shell script
Insert the following lines into the file
echo Your external IP Address is:
wget http://Www.whatismyip.com -O - -o /dev/null | grep '<TITLE>' | sed -r 's/<TITLE>WhatIsMyIP\.com \- //g' | sed -r 's/<\/TITLE>//g'
Save and exit the file
Now you need to change the permissions using the following command
chmod u+x bin/whatismyip.sh
Now you can check your external IP Address by running