summaryrefslogtreecommitdiff
path: root/monitor.sh
diff options
context:
space:
mode:
authorF3RR3T <github@st33v.com>2014-09-10 09:59:08 +1000
committerF3RR3T <github@st33v.com>2014-09-10 09:59:08 +1000
commitce4fdc73baecddba53c78593806c687b892f6a0c (patch)
treed804799b83d65631df74fe215a4d9a3c9f0e0347 /monitor.sh
parent82885d54288593b5714ee8c719d1f3f075d40386 (diff)
remember to use -a in commit
Diffstat (limited to 'monitor.sh')
-rwxr-xr-xmonitor.sh7
1 files changed, 2 insertions, 5 deletions
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