|
2 | 2 |
|
3 | 3 | apt-get update && apt-get install -y sendmail wget vim cron |
4 | 4 |
|
5 | | -wget https://dl.eff.org/certbot-auto \ |
6 | | - && mv certbot-auto /usr/local/bin/certbot-auto \ |
7 | | - && chown root /usr/local/bin/certbot-auto \ |
8 | | - && chmod 0755 /usr/local/bin/certbot-auto \ |
9 | | - && certbot-auto --version -n |
| 5 | +wget --no-check-certificate https://dl.eff.org/certbot-auto \ |
| 6 | + && mv certbot-auto /usr/local/bin/certbot-auto \ |
| 7 | + && chown root /usr/local/bin/certbot-auto \ |
| 8 | + && chmod 0755 /usr/local/bin/certbot-auto \ |
| 9 | + && certbot-auto --version -n |
10 | 10 |
|
11 | | -if ! test -d /etc/letsencrypt/live/<domain>; then certbot-auto -n certonly -n --webroot -w /www/<web root folder>/ -d <domain> --agree-tos -m <mail address>; fi |
| 11 | +#if ! test -d /etc/letsencrypt/live/cococok.com ; |
| 12 | +if ! test -d /ssl/letsencrypt/live/cococok.com ; then |
| 13 | + echo "try to get authentication key using certbot-auto " |
| 14 | + certbot-auto -n certonly -n --webroot -w /www/cococok/ -d cococok.com --agree-tos -m bluebamus@naver.com; |
| 15 | + cp /etc/letsencrypt/ /ssl/letsencrypt/ -rf |
| 16 | +else |
| 17 | + echo "copy letsencrypt folder by already maden" |
| 18 | + cp /ssl/letsencrypt/ /etc/letsencrypt/ -rf |
| 19 | +fi |
12 | 20 |
|
13 | | -if ! test -f /etc/ssl/certs/dhparam.pem; then openssl dhparam -out /etc/ssl/certs/dhparam.pem 4096; fi |
| 21 | +#if ! test -f /etc/ssl/certs/dhparam.pem ; |
| 22 | +if test -f /ssl/ssl/certs/dhparam.pem ; then |
| 23 | + echo "try to get ssl key using openssl " |
| 24 | + openssl dhparam -out /etc/ssl/certs/dhparam.pem 4096; |
| 25 | + cp /etc/ssl/certs/dhparam.pem /ssl/certs/dhparam.pem -rf |
| 26 | +else |
| 27 | + echo "copy ssl folder by already maden" |
| 28 | + cp /ssl/certs/dhparam.pem /etc/ssl/certs/dhparam.pem -rf |
| 29 | +fi |
14 | 30 |
|
15 | 31 | cat <(crontab -l) <(echo "0 5 * * 1 certbot-auto renew --quiet --renew-hook "/etc/init.d/nginx reload"") | crontab - |
0 commit comments