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 ++----- notifynewip.sh | 3 ++- zz.sh | 7 ------- 3 files changed, 4 insertions(+), 13 deletions(-) delete mode 100755 zz.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 diff --git a/notifynewip.sh b/notifynewip.sh index 5542d86..bc4ca60 100755 --- a/notifynewip.sh +++ b/notifynewip.sh @@ -25,6 +25,7 @@ EOF uptime >> emailbody.txt -cat emailbody.txt | mail -A cumquat -s "IP has changed" st33v@st33v.com +cat emailbody.txt | mail -A cumquat -s "IP has changed" $EMAILST33V +rm emailbody.txt diff --git a/zz.sh b/zz.sh deleted file mode 100755 index 3cb0bb4..0000000 --- a/zz.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -echo "User ID is $UID (eh)" - - - - -- cgit v1.3