-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathmailhome.sh
executable file
·76 lines (67 loc) · 1.55 KB
/
mailhome.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#! /bin/sh
# mailhome.sh - send a message back to CWP
# John Stockwell, Center for Wave Phenomena, 1 August 1997
#set -x
# these items identify the date/release of the codes
DATE="9 February 2020"
RELEASE=${VERSION}
# home address
ADDRESS="[email protected]"
# message
MESSAGE="Installing the $DATE version (Release ${RELEASE}) of OpenSeaSeis."
YOURADDRESS=
echo
echo
echo "######################"
echo "######################"
echo
echo
echo "To give us at CWP an idea of who uses OpenSeaSeis"
echo "the master Makefile will email the following message:"
echo
echo " \"${MESSAGE}\" "
echo
echo "to: \"${ADDRESS}\" "
echo
echo
echo
echo "You will then be put on the OpenSeaSeis e-mail list"
echo "and will be informed of future updates of the OpenSeaSeis."
echo
echo
echo "However, if you would rather not have this message sent"
echo "you may specify this as your response to the next query."
echo
echo
echo "Send automatic mail message back to CWP?[y/n]" | tr -d "\012"
read RESP
case $RESP in
y*|Y*) # continue
ok=false
while [ $ok = false ]
do
echo "please type your e-mail address: " | tr -d "\012"
read YOURADDRESS
#check to see if address is correct
echo "is $YOURADDRESS correct?[y/n]" | tr -d "\012"
read ISADDRESSOK
case $ISADDRESSOK in
n*) ok=false
;;
*) ok=true
echo "$MESSAGE $YOURADDRESS" | mail $ADDRESS
echo
echo
echo "Beginning installation process"
echo
echo
sleep 5
;;
esac
done
;;
*) # don't send the message
echo "Continuing without sending the mailing."
;;
esac
exit 0