#!/bin/sh # Get the current external IP(v4) address # Exchange "YOUR.PUBLIC.IP.SITE" with the URL of a website that provides your public IP. wget -qO- http://YOUR.PUBLIC.IP.SITE/|grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'