Parcourir la source

Try to prevent any collisions between upgrades and letsencrypt certificate updates

Bob Mottram il y a 6 ans
Parent
révision
e20a24a9ca
2 fichiers modifiés avec 12 ajouts et 0 suppressions
  1. 3
    0
      src/freedombone-utils-git
  2. 9
    0
      src/freedombone-utils-web

+ 3
- 0
src/freedombone-utils-git Voir le fichier

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

+ 9
- 0
src/freedombone-utils-web Voir le fichier

@@ -365,6 +365,10 @@ function letsencrypt_renewals {
365 365
     # a secondary script keeps trying to renew after a failure
366 366
     { echo '#!/bin/bash';
367 367
       echo '';
368
+      echo 'if [ -f /tmp/.upgrading ]; then';
369
+      echo '    exit 0';
370
+      echo 'fi';
371
+      echo '';
368 372
       echo "PROJECT_NAME='${PROJECT_NAME}'";
369 373
       echo "COMPLETION_FILE=\$HOME/\${PROJECT_NAME}-completed.txt";
370 374
       echo '';
@@ -377,6 +381,11 @@ function letsencrypt_renewals {
377 381
       echo "}')";
378 382
       echo "        ADMIN_EMAIL_ADDRESS=\$ADMIN_USERNAME@\$HOSTNAME";
379 383
       echo '        for d in /etc/letsencrypt/live/*/ ; do';
384
+      echo '';
385
+      echo '            if [ -f /tmp/.upgrading ]; then';
386
+      echo '                exit 0';
387
+      echo '            fi';
388
+      echo '';
380 389
       echo -n "            LETSENCRYPT_DOMAIN=\$(echo \"\$d\" | ";
381 390
       echo -n "awk -F '/' '{print ";
382 391
       echo -n "\$5";