Browse Source

If a collision happens between cert upgrade and general upgrade then create the failure file so that retries will happen

Bob Mottram 6 years ago
parent
commit
99fc662547
1 changed files with 21 additions and 0 deletions
  1. 21
    0
      src/freedombone-utils-web

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

316
     # the main script tries to renew once per month
316
     # the main script tries to renew once per month
317
     { echo '#!/bin/bash';
317
     { echo '#!/bin/bash';
318
       echo '';
318
       echo '';
319
+      echo 'if [ -f /tmp/.upgrading ]; then';
320
+      echo '    if [ ! -f ~/letsencrypt_failed ]; then';
321
+      echo '        touch ~/letsencrypt_failed';
322
+      echo '    fi';
323
+      echo '    exit 0';
324
+      echo 'fi';
325
+      echo '';
319
       echo "PROJECT_NAME='${PROJECT_NAME}'";
326
       echo "PROJECT_NAME='${PROJECT_NAME}'";
320
       echo "COMPLETION_FILE=\$HOME/\${PROJECT_NAME}-completed.txt";
327
       echo "COMPLETION_FILE=\$HOME/\${PROJECT_NAME}-completed.txt";
321
       echo '';
328
       echo '';
329
       echo "}')";
336
       echo "}')";
330
       echo "    ADMIN_EMAIL_ADDRESS=\$ADMIN_USERNAME@\$HOSTNAME";
337
       echo "    ADMIN_EMAIL_ADDRESS=\$ADMIN_USERNAME@\$HOSTNAME";
331
       echo '    for d in /etc/letsencrypt/live/*/ ; do';
338
       echo '    for d in /etc/letsencrypt/live/*/ ; do';
339
+      echo '';
340
+      echo '        if [ -f /tmp/.upgrading ]; then';
341
+      echo '            if [ ! -f ~/letsencrypt_failed ]; then';
342
+      echo '                touch ~/letsencrypt_failed';
343
+      echo '            fi';
344
+      echo '            exit 0';
345
+      echo '        fi';
346
+      echo '';
332
       echo -n "        LETSENCRYPT_DOMAIN=\$(echo \"\$d\" | ";
347
       echo -n "        LETSENCRYPT_DOMAIN=\$(echo \"\$d\" | ";
333
       echo -n "awk -F '/' '{print ";
348
       echo -n "awk -F '/' '{print ";
334
       echo -n "\$5";
349
       echo -n "\$5";
366
     { echo '#!/bin/bash';
381
     { echo '#!/bin/bash';
367
       echo '';
382
       echo '';
368
       echo 'if [ -f /tmp/.upgrading ]; then';
383
       echo 'if [ -f /tmp/.upgrading ]; then';
384
+      echo '    if [ ! -f ~/letsencrypt_failed ]; then';
385
+      echo '        touch ~/letsencrypt_failed';
386
+      echo '    fi';
369
       echo '    exit 0';
387
       echo '    exit 0';
370
       echo 'fi';
388
       echo 'fi';
371
       echo '';
389
       echo '';
383
       echo '        for d in /etc/letsencrypt/live/*/ ; do';
401
       echo '        for d in /etc/letsencrypt/live/*/ ; do';
384
       echo '';
402
       echo '';
385
       echo '            if [ -f /tmp/.upgrading ]; then';
403
       echo '            if [ -f /tmp/.upgrading ]; then';
404
+      echo '                if [ ! -f ~/letsencrypt_failed ]; then';
405
+      echo '                    touch ~/letsencrypt_failed';
406
+      echo '                fi';
386
       echo '                exit 0';
407
       echo '                exit 0';
387
       echo '            fi';
408
       echo '            fi';
388
       echo '';
409
       echo '';