diff options
| author | F3RR3T <github@st33v.com> | 2014-09-06 22:04:16 +1000 |
|---|---|---|
| committer | F3RR3T <github@st33v.com> | 2014-09-06 22:04:16 +1000 |
| commit | e779a2afe559d67bef12bb57f1a4ce0de06b9c81 (patch) | |
| tree | e75ae52ce5eb8019227ae5ab2b9d20c81fbb44bf /notifynewip.sh | |
| parent | e90ead311dff1bccd50cbea8e2e915c185537e53 (diff) | |
Monitor now ckecks for IP change and invokes email notification
Diffstat (limited to 'notifynewip.sh')
| -rwxr-xr-x | notifynewip.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/notifynewip.sh b/notifynewip.sh new file mode 100755 index 0000000..5542d86 --- /dev/null +++ b/notifynewip.sh @@ -0,0 +1,30 @@ +#! /bin/bash - + +# SJP 6 Sept 2014 +# send an email telling me that the IP address has changed +# called from monitor.sh + +cd ~/mail/monitor + +cat <<- EOF > emailbody.txt + Notification of changed IP address + ================================== + + The IP address of cumquat has changed. + + Old IP and date of recording: +EOF + +cat data/tmp.* >> emailbody.txt + +cat <<- EOF >> emailbody.txt + New IP: $ip + Date : $dt + +EOF + +uptime >> emailbody.txt + +cat emailbody.txt | mail -A cumquat -s "IP has changed" st33v@st33v.com + + |
