From 2f9df3d640a7fb1c2f0d40d013d417a0cb057e54 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 29 Jun 2017 18:15:06 +0200 Subject: [PATCH] check if service is running (master) --- lets-encrypt/test-new-config.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lets-encrypt/test-new-config.sh b/lets-encrypt/test-new-config.sh index dd695bfc..b50a60bf 100644 --- a/lets-encrypt/test-new-config.sh +++ b/lets-encrypt/test-new-config.sh @@ -53,6 +53,12 @@ if ! certbot renew --pre-hook "service apache2 stop" --post-hook "service apache else echo "Let's Encrypt SUCCESS!"--$DATE >> /var/log/letsencrypt/cronjob.log fi + +# Check if service is running +if ! pgrep apache2 > /dev/null +then + service apache2 start +fi CRONTAB } add_crontab_le