Browse Source

Try to prevent any collisions between upgrades and letsencrypt certificate updates

Bob Mottram 6 years ago
parent
commit
e20a24a9ca
2 changed files with 12 additions and 0 deletions
  1. 3
    0
      src/freedombone-utils-git
  2. 9
    0
      src/freedombone-utils-web

+ 3
- 0
src/freedombone-utils-git View File

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

+ 9
- 0
src/freedombone-utils-web View File

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