summaryrefslogtreecommitdiff
path: root/notifynewip.sh
blob: 5542d86f1e6a10bd1ae6b48414b3b23af08ce74a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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