diff options
| author | F3RR3T <github@st33v.com> | 2014-09-10 09:59:08 +1000 |
|---|---|---|
| committer | F3RR3T <github@st33v.com> | 2014-09-10 09:59:08 +1000 |
| commit | ce4fdc73baecddba53c78593806c687b892f6a0c (patch) | |
| tree | d804799b83d65631df74fe215a4d9a3c9f0e0347 /monitor.sh | |
| parent | 82885d54288593b5714ee8c719d1f3f075d40386 (diff) | |
remember to use -a in commit
Diffstat (limited to 'monitor.sh')
| -rwxr-xr-x | monitor.sh | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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 |
