From 00b223140455d00fe159026d8f621e55e7581d21 Mon Sep 17 00:00:00 2001 From: HeyJack Date: Thu, 15 Oct 2020 16:23:52 +0100 Subject: [PATCH] Remade Certbot Install --- install.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 535ab78..6d83a37 100644 --- a/install.sh +++ b/install.sh @@ -1769,7 +1769,7 @@ ssl_certs(){ fi fi - if [ "$lsb_dist" = "debian" ] || [ "$lsb_dist" = "ubuntu" ]; then + if [ "$lsb_dist" = "debian" ] || [ "$lsb_dist" = "ubuntu" ]; then if [ "$installoption" = "1" ]; then if [ "$webserver" = "1" ]; then (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service nginx stop" --post-hook "service nginx restart" >> /dev/null 2>&1')| crontab - @@ -1783,10 +1783,9 @@ ssl_certs(){ (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service apache2 stop" --post-hook "service apache2 restart" >> /dev/null 2>&1')| crontab - fi elif [ "$installoption" = "3" ]; then - (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "ufw allow 80" --pre-hook "service wings stop" --post-hook "ufw deny 80" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab - + (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "ufw allow 80" --pre-hook "service wings stop" --post-hook "ufw deny 80" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab - elif [ "$installoption" = "4" ]; then - (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "ufw allow 80" --pre-hook "service wings stop" --post-hook "ufw deny 80" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab - - fi + (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "ufw allow 80" --pre-hook "service wings stop" --post-hook "ufw deny 80" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab - elif [ "$installoption" = "5" ]; then if [ "$webserver" = "1" ]; then (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service nginx stop" --pre-hook "service wings stop" --post-hook "service nginx restart" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab - @@ -1799,7 +1798,7 @@ ssl_certs(){ elif [ "$webserver" = "2" ]; then (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service apache2 stop" --pre-hook "service wings stop" --post-hook "service apache2 restart" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab - fi - fi + fi elif [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "rhel" ]; then if [ "$installoption" = "1" ]; then if [ "$webserver" = "1" ]; then @@ -1823,13 +1822,18 @@ ssl_certs(){ elif [ "$webserver" = "2" ]; then (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service httpd stop" --pre-hook "service wings stop" --post-hook "service httpd restart" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab - fi - elif [ "$installoption" = "6" ]; then + elif [ "$installoption" = "5" ]; then + if [ "$webserver" = "1" ]; then + (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service nginx stop" --pre-hook "service wings stop" --post-hook "service nginx restart" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab - + elif [ "$webserver" = "2" ]; then + (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service httpd stop" --pre-hook "service wings stop" --post-hook "service httpd restart" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab - + fi + elif [ "$installoption" = "6" ]; then if [ "$webserver" = "1" ]; then (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service nginx stop" --pre-hook "service wings stop" --post-hook "service nginx restart" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab - elif [ "$webserver" = "2" ]; then (crontab -l ; echo '0 0,12 * * * certbot renew --pre-hook "service httpd stop" --pre-hook "service wings stop" --post-hook "service httpd restart" --post-hook "service wings restart" >> /dev/null 2>&1')| crontab - fi - fi fi }