From 4648a893f95a8ae41be554a7a302eb2bc9fd6c38 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 20 Oct 2016 02:10:58 +0200 Subject: [PATCH] -eq 0 and $SCRIPTS --- lets-encrypt/test-new-config.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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