diff --git a/lets-encrypt/test-new-config.sh b/lets-encrypt/test-new-config.sh index 07c430e8..a903f4bf 100644 --- a/lets-encrypt/test-new-config.sh +++ b/lets-encrypt/test-new-config.sh @@ -26,17 +26,16 @@ then read -p "Press any key to continue... " -n1 -s echo -e "\e[0m" crontab -u root -l | { cat; echo "@monthly $SCRIPTS/letsencryptrenew.sh"; } | crontab -u root - -cat << CRONTAB > "/var/scripts/letsencryptrenew.sh" +cat << CRONTAB > "$SCRIPTS/letsencryptrenew.sh" #!/bin/sh -set -x -systemctl stop apache2.service +service nginx stop if ! /opt/letsencrypt/letsencrypt-auto renew > /var/log/letsencrypt/renew.log 2>&1 ; then echo Automated renewal failed: cat /var/log/letsencrypt/renew.log exit 1 fi -systemctl start apache2.service -if [[ $? == 0 ]] +service nginx start +if [[ $? -eq 0 ]] then echo "Let's Encrypt SUCCESS!"--$(date +%Y-%m-%d_%H:%M) >> /var/log/letsencrypt/cronjob.log else