#!/bin/bash myip="$(dig +short myip.opendns.com @resolver1.opendns.com)" #echo "My public IP address is: ${myip}" echo "${myip}"