File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change 11#!/usr/local/lib/mailinabox/env/bin/python
22# Utilities for installing and selecting SSL certificates.
33
4+ import sys
45import os
56import os .path
67import re
78import shutil
89import subprocess
910import tempfile
1011
12+ from exclusiveprocess import Lock
1113from utils import shell , safe_domain_name , sort_domains
1214import idna
1315
@@ -426,15 +428,8 @@ def provision_certificates(env, limit_domains):
426428 return ret
427429
428430
429- def provision_certificates_cmdline ():
430- import sys
431- from exclusiveprocess import Lock
432-
433- from utils import load_environment
434-
435- Lock (die = True ).forever ()
436- env = load_environment ()
437-
431+ @Lock (die = True )
432+ def provision_certificates_cmdline (env ):
438433 quiet = False
439434 domains = []
440435
@@ -781,5 +776,16 @@ def idna_decode_dns_name(dns_name):
781776
782777
783778if __name__ == "__main__" :
779+ from utils import load_environment
780+ env = load_environment ()
781+
784782 # Provision certificates.
785- provision_certificates_cmdline ()
783+ provision_certificates_cmdline (env )
784+
785+ # Failsafe
786+ args = sys .argv [0 :1 ]
787+ if "-q" in sys .argv :
788+ args .append ('-q' )
789+ args .append (env ['PRIMARY_HOSTNAME' ])
790+ sys .argv = args
791+ provision_certificates_cmdline (env )
You can’t perform that action at this time.
0 commit comments