-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathssl-dns.sh
47 lines (39 loc) · 895 Bytes
/
ssl-dns.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
########## Variables ####################
#default website
WEBSITE="example.com"
#default admin subwebsite
ADMINSD="tools"
#default origin subwebsite
ORIGINSD="origin"
for i in "$@"
do
case $i in
-w=*|--website=*)
WEBSITE="${i#*=}"
shift
;;
-asd=*|--adminsd=*)
ADMINSD="${i#*=}"
shift
;;
-osd=*|--originsd=*)
ORIGINSD="${i#*=}"
shift
;;
--default)
DEFAULT=YES
shift # past argument with no value
;;
*)
# unknown option
;;
esac
done
########## Issue Key by DNS Challenge #################
# DNS Challenge
certbot -d $WEBSITE -d www.$WEBSITE -d $ADMINSD.$WEBSITE -d $ORIGINSD.$WEBSITE --manual --preferred-challenges dns certonly
# give TXT record for all three domains with given name and value pair
if [ ! -f /etc/ssl/certs/dhparam.pem ]; then
cd /etc/ssl/certs
openssl dhparam -out dhparam.pem 4096
fi