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
@@ -33,8 +33,6 @@ def parse_arguments():
|
||||
subparsers = parser.add_subparsers(dest='subcommand', help='Sub command')
|
||||
|
||||
subparsers.add_parser('setup', help='Configure repro')
|
||||
subparsers.add_parser('enable', help='Enable repro service')
|
||||
subparsers.add_parser('disable', help='Disable repro service')
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
@@ -61,16 +59,6 @@ def subcommand_setup(_):
|
||||
action_utils.webserver_enable('repro-plinth')
|
||||
|
||||
|
||||
def subcommand_enable(_):
|
||||
"""Start service."""
|
||||
action_utils.service_enable('repro')
|
||||
|
||||
|
||||
def subcommand_disable(_):
|
||||
"""Stop service."""
|
||||
action_utils.service_disable('repro')
|
||||
|
||||
|
||||
def main():
|
||||
"""Parse arguments and perform all duties."""
|
||||
arguments = parse_arguments()
|
||||
|
||||
Reference in new issue
Block a user