mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Service object to handle services on a system-level
The Service object now offers handling services on a system level, and gathering information whether it's enabled or running. New methods: enable, disable, is_enabled, is_running; For this it needs the correct (system-level) service name. All of the methods can be overridden/customized. This changes all modules to the new Service object and deletes action scripts that are not required anymore.
This commit is contained in:
1 parent
9fe49f881f
commit
a9528c56d9
30 files changed
+243
-629
No files matched your search
@@ -64,13 +64,13 @@ def init():
|
||||
global socks_service
|
||||
socks_service = service_module.Service(
|
||||
'tor-socks', _('Tor Anonymity Network'),
|
||||
is_external=False, enabled=is_enabled())
|
||||
is_external=False, is_enabled=is_enabled, is_running=is_running)
|
||||
|
||||
global bridge_service
|
||||
bridge_service = service_module.Service(
|
||||
'tor-bridge', _('Tor Bridge Relay'),
|
||||
ports=['tor-orport', 'tor-obfs3', 'tor-obfs4'],
|
||||
is_external=True, enabled=is_enabled())
|
||||
is_external=True, is_enabled=is_enabled, is_running=is_running)
|
||||
|
||||
# Register hidden service name with Name Services module.
|
||||
hs_info = get_hs()
|
||||
|
||||
Reference in new issue
Block a user