From ce4fdc73baecddba53c78593806c687b892f6a0c Mon Sep 17 00:00:00 2001 From: F3RR3T Date: Wed, 10 Sep 2014 09:59:08 +1000 Subject: remember to use -a in commit --- monitor.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'monitor.sh') diff --git a/monitor.sh b/monitor.sh index 1bf5129..2315915 100755 --- a/monitor.sh +++ b/monitor.sh @@ -15,18 +15,15 @@ else newfile=1 fi -# echo "datafile = $datafile" - ip=$(curl ifconfig.me/ip) -[ ${#ip} = 0 ] && ip="Timed out" -# Could also do [ -z $ip ] +[ ${#ip} = 0 ] && exit 1 # Could also do [ -z $ip ] dt=$(\date +%Y-%m-%dT%T%:z) # either write date + IP to new file or compare IPs # write date and IP address to file but delete if it's a dud if (test "$newfile" -eq 1) then echo -e "$dt\t$ip" > $datafile - [ "$ip" == "Timed out" ] && rm $datafile + # [ "$ip" == "Timed out" ] && rm $datafile else # datafile already exists, so compare read line < $datafile -- cgit v1.3