From 8a2aba56e1303aba973593e89e5e4f27b06df128 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 16 Nov 2021 14:03:48 +0100 Subject: [PATCH] backend: add detach option for long running actions --- src/opnsense/service/configd_ctl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/opnsense/service/configd_ctl.py b/src/opnsense/service/configd_ctl.py index 44ffa0ef7..8dc34c91f 100755 --- a/src/opnsense/service/configd_ctl.py +++ b/src/opnsense/service/configd_ctl.py @@ -82,6 +82,7 @@ def exec_config_cmd(exec_command): parser = argparse.ArgumentParser() parser.add_argument("-m", help="execute multiple arguments at once", action="store_true") parser.add_argument("-e", help="use as event handler, execute command on receiving input", action="store_true") +parser.add_argument("-d", help="detach the execution of the command and return immediately", action="store_true") parser.add_argument( "-t", help="threshold between events, wait this interval before executing commands, combine input into single events", @@ -143,6 +144,8 @@ if args.e: else: # normal execution mode for exec_command in exec_commands: + if args.d: + exec_command = '&' + exec_command result=exec_config_cmd(exec_command=exec_command) if result is None: sys.exit(-1)