diff options
Diffstat (limited to 'backend/resilient')
-rw-r--r-- | backend/resilient/__init__.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/backend/resilient/__init__.py b/backend/resilient/__init__.py index c42b5d1..ba994a6 100644 --- a/backend/resilient/__init__.py +++ b/backend/resilient/__init__.py @@ -126,10 +126,6 @@ class ikiwiki: class zeronet: - running = url200('http://127.0.0.1:43110/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D') - if not running: - print("WARNING: ZeroNet not running, won't be used") - found = 'ZERONETDIR' in os.environ if found: zn_datadir = os.path.join(os.environ['ZERONETDIR'], 'ZeroNet/data') @@ -138,6 +134,15 @@ class zeronet: if not found: print("WARNING: ZeroNet bundle not found in ZERONETDIR, public zeronet site won't be updated") + running = url200('http://127.0.0.1:43110/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D') + if found and not running: + proc = subprocess.Popen([zn_script]) + while not running and proc.returncode == None: + time.sleep(0.5) + running = url200('http://127.0.0.1:43110/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D') + if not running: + print("WARNING: ZeroNet not running, won't be used") + def __init__(self, addr, key): self.addr = addr self.key = key |