Check your public IP using bash

sudo nano -w /usr/local/bin/whatismyip

 

#!/bin/sh
wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
 
sudo chmod +x /usr/local/bin/whatismyip