Advertisement
Guest User

Untitled

a guest
Dec 30th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. # Renew Let's Encrypt SSL
  2.  
  3. cd /root/letsencrypt/
  4. ./letsencrypt-auto certonly -a webroot --renew-by-default --webroot-path /home/admin/web/網域/public_html -d 網域
  5. cat /etc/letsencrypt/live/網域/cert.pem /etc/letsencrypt/live/網域/chain.pem > /usr/local/vesta/ssl/certificate.crt
  6.  
  7. if [ $? -ne 0 ]
  8. then
  9. ERRORLOG=`tail /var/log/letsencrypt/letsencrypt.log`
  10. echo -e "The Lets Encrypt Cert has not been renewed! \n \n" $ERRORLOG | mail -s "Lets Encrypt Cert Alert" mail@gmail.com
  11. else
  12. service nginx restart
  13. service apache2 restart
  14. echo -e "The Lets Encrypt Cert has been renewed! \n \n" $ERRORLOG | mail -s "Lets Encrypt Cert Alert" mail@gmail.com
  15. fi
  16.  
  17. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement