Last active
December 14, 2015 22:09
Revisions
-
paulbdavis renamed this gist
Mar 13, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
paulbdavis created this gist
Mar 13, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/usr/bin/env bash if [ "$1" = "-r" ] then rm $HOME/.externalip exit 0; fi cacheFile="$HOME/.externalip" if [ ! -f "$cacheFile" ] || [ ! "$(cat $cacheFile)" ] then wget http://checkip.dyndns.org/ -q -O - | grep -Eo '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>' > "$cacheFile" fi echo $(cat "$cacheFile")