-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathprompt-email
executable file
·40 lines (39 loc) · 1.07 KB
/
prompt-email
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
#!/bin/sh
set -e
getemail () {
printf "email address> "
read e1
if ! echo "$e1" | grep -q '@'; then
echo "That does not look like an email address. Try again.." >&2
getemail
fi
if ! echo "$e1" | grep -q '\.'; then
echo "That does not look like an fully qualified domain. Try again.." >&2
getemail
fi
if echo "$e1" | grep -q ' '; then
echo "Please enter a bare [email protected] address. It cannot contain any spaces." >&2
getemail
fi
printf "re-enter email address to verify> "
read e2
if [ "$e1" = "$e2" ] && [ ! -z "$e1" ]; then
echo "Thanks!"
else
echo "Emails don't match! Try again.." >&2
getemail
fi
echo "$e1" > .registrationemail
}
echo ""
echo "To register to participate in the IA.BAK project, please"
echo "enter a contact email address."
echo ""
echo "We will keep this email private, and only use it to contact"
echo "you if there is a problem with your portion of the Internet"
echo "Archive backup."
echo ""
echo "It's important we have a way to get in touch with you,"
echo "so that this backup can be as reliable as possible!"
echo ""
getemail