Try to prevent any collisions between upgrades and letsencrypt certificate updates

This commit is contained in:
Bob Mottram 2018-06-09 10:10:01 +01:00
parent 58b059c803
commit e20a24a9ca
2 changed files with 12 additions and 0 deletions

View File

@ -50,6 +50,9 @@ function git_pull {
git branch -D "$2"
# check out the new branch
if ! git checkout "$2" -b "$2"; then
if [ -f /tmp/.upgrading ]; then
rm /tmp/.upgrading
fi
echo $"Unable to checkout $1 $2"
exit 72357
fi

View File

@ -364,6 +364,10 @@ function letsencrypt_renewals {
# a secondary script keeps trying to renew after a failure
{ echo '#!/bin/bash';
echo '';
echo 'if [ -f /tmp/.upgrading ]; then';
echo ' exit 0';
echo 'fi';
echo '';
echo "PROJECT_NAME='${PROJECT_NAME}'";
echo "COMPLETION_FILE=\$HOME/\${PROJECT_NAME}-completed.txt";
@ -377,6 +381,11 @@ 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 ' exit 0';
echo ' fi';
echo '';
echo -n " LETSENCRYPT_DOMAIN=\$(echo \"\$d\" | ";
echo -n "awk -F '/' '{print ";
echo -n "\$5";