File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ if [[ -z " $1 " ]]
4+ then echo " Missing mandatory path parameter"
5+ exit
6+ fi
7+
8+ DOMAIN_PATH=" $HOME /build/dane/$1 "
9+
10+ if [[ ! -d $DOMAIN_PATH ]]
11+ then echo " Path $PATH does not exist"
12+ exit
13+ fi
14+
15+ if [[ $1 == " mail" ]]
16+ then
17+ FILENAME=" mail"
18+ else
19+ FILENAME=" nginx"
20+ fi
21+
22+ cd $DOMAIN_PATH
23+ letsencrypt certonly --webroot -w /var/www/letsencrypt/letsencrypt-auth --key-path privkey.pem --cert-path cert.pem --fullchain-path fullchain.pem --csr request.csr
24+
25+ FULLCHAIN=` ls -t * _fullchain.pem | head -1`
26+
27+ sudo ln -snf $DOMAIN_PATH /$FULLCHAIN /etc/ssl/$1 /$FILENAME .crt
28+
29+ sudo service postfix restart
30+ sudo service dovecot restart
31+ sudo service nginx restart
32+
33+ echo " New Certificates for \" $1 \" created!"
You can’t perform that action at this time.
0 commit comments