Skip to content
Snippets Groups Projects
Commit e20a24a9 authored by Bob Mottram's avatar Bob Mottram
Browse files

Try to prevent any collisions between upgrades and letsencrypt certificate updates

parent 58b059c8
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment