From 35645a7ec0c381681c15bdd015a1ee6178620d28 Mon Sep 17 00:00:00 2001 From: Fabian Thielen Date: Tue, 9 Jan 2018 21:20:52 +0100 Subject: [PATCH] Check if files/folders exists, remove reload-hook --- install.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 0fc5306..3dd8a9e 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,12 @@ #!/bin/bash -rm -rf /usr/local/nginx -rm /etc/systemd/system/nginx.service +if [[ -d /usr/local/nginx ]]; then + rm -rf /usr/local/nginx +fi + +if [[ -f /etc/systemd/system/nginx.service ]]; then + rm /etc/systemd/system/nginx.service +fi lowercase(){ echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" @@ -67,7 +72,7 @@ if [ "$ifle" == "Y" ] || [ "$ifle" == "y" ]; then ln -s /opt/certbot/certbot-auto /usr/local/bin/letsencrypt cp make_cert /usr/local/bin chmod +x /usr/local/bin/make_cert - crontab -l | { cat; echo "@weekly certbot renew --pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx' --renew-hook 'systemctl reload nginx' --quiet"; } | crontab - + crontab -l | { cat; echo "@weekly certbot renew --pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx' --quiet"; } | crontab - fi if [ "$DIST" == "Fedora" ]; then