From 99fc6625471c163bfdfed4c17ee66ecf21803cee Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 9 Jun 2018 10:15:14 +0100 Subject: [PATCH] If a collision happens between cert upgrade and general upgrade then create the failure file so that retries will happen --- src/freedombone-utils-web | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/freedombone-utils-web b/src/freedombone-utils-web index ac45b0b8..9c3b8b0f 100755 --- a/src/freedombone-utils-web +++ b/src/freedombone-utils-web @@ -315,6 +315,13 @@ function letsencrypt_renewals { # the main script tries to renew once per month { echo '#!/bin/bash'; + echo ''; + echo 'if [ -f /tmp/.upgrading ]; then'; + echo ' if [ ! -f ~/letsencrypt_failed ]; then'; + echo ' touch ~/letsencrypt_failed'; + echo ' fi'; + echo ' exit 0'; + echo 'fi'; echo ''; echo "PROJECT_NAME='${PROJECT_NAME}'"; echo "COMPLETION_FILE=\$HOME/\${PROJECT_NAME}-completed.txt"; @@ -329,6 +336,14 @@ function letsencrypt_renewals { echo "}')"; echo " ADMIN_EMAIL_ADDRESS=\$ADMIN_USERNAME@\$HOSTNAME"; echo ' for d in /etc/letsencrypt/live/*/ ; do'; + echo ''; + echo ' if [ -f /tmp/.upgrading ]; then'; + echo ' if [ ! -f ~/letsencrypt_failed ]; then'; + echo ' touch ~/letsencrypt_failed'; + echo ' fi'; + echo ' exit 0'; + echo ' fi'; + echo ''; echo -n " LETSENCRYPT_DOMAIN=\$(echo \"\$d\" | "; echo -n "awk -F '/' '{print "; echo -n "\$5"; @@ -366,6 +381,9 @@ function letsencrypt_renewals { { echo '#!/bin/bash'; echo ''; echo 'if [ -f /tmp/.upgrading ]; then'; + echo ' if [ ! -f ~/letsencrypt_failed ]; then'; + echo ' touch ~/letsencrypt_failed'; + echo ' fi'; echo ' exit 0'; echo 'fi'; echo ''; @@ -383,6 +401,9 @@ function letsencrypt_renewals { echo ' for d in /etc/letsencrypt/live/*/ ; do'; echo ''; echo ' if [ -f /tmp/.upgrading ]; then'; + echo ' if [ ! -f ~/letsencrypt_failed ]; then'; + echo ' touch ~/letsencrypt_failed'; + echo ' fi'; echo ' exit 0'; echo ' fi'; echo '';