summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmonitor.sh7
-rwxr-xr-xnotifynewip.sh3
-rwxr-xr-xzz.sh7
3 files changed, 4 insertions, 13 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
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)"
-
-
-
-