tor: Don't check if enabled when not installed

Tests:

- Install Tor and enable onion service. Restart FreedomBox. During
initialization the onion service domain is added. Check in Name Services.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2020-09-27 09:54:20 -04:00
1 parent 9b9238188a
commit 7b7d42fe33
1 file changed
+3 -1
+3 -1
View File
@@ -87,7 +87,9 @@ class TorApp(app_module.App):
self.add(users_and_groups)
# Register hidden service name with Name Services module.
if self.is_enabled() and app_is_running(self):
setup_helper = globals()['setup_helper']
if setup_helper.get_state() != 'needs-setup' and \
self.is_enabled() and app_is_running(self):
status = utils.get_status(initialized=False)
hostname = status['hs_hostname']
services = [int(port['virtport']) for port in status['hs_ports']]