diff options
| -rwxr-xr-x | monitor.sh | 7 | ||||
| -rwxr-xr-x | notifynewip.sh | 3 | ||||
| -rwxr-xr-x | zz.sh | 7 |
3 files changed, 4 insertions, 13 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 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 @@ -1,7 +0,0 @@ -#!/bin/bash - -echo "User ID is $UID (eh)" - - - - |
