mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 17:44:41 +00:00
backend: add default argument to configctl
PR: https://forum.opnsense.org/index.php?topic=41501.0
This commit is contained in:
parent
e406d51219
commit
e50780e531
@ -88,7 +88,7 @@ parser.add_argument(
|
||||
help="threshold between events, wait this interval before executing commands, combine input into single events",
|
||||
type=float
|
||||
)
|
||||
parser.add_argument("command", help="command(s) to execute", nargs="+")
|
||||
parser.add_argument("command", help="command(s) to execute", nargs="*")
|
||||
args = parser.parse_args()
|
||||
|
||||
syslog.openlog(os.path.basename(sys.argv[0]))
|
||||
@ -110,9 +110,17 @@ if not os.path.exists(configd_socket_name):
|
||||
|
||||
# command(s) to execute
|
||||
if args.m:
|
||||
# select list command when not otherwise specified
|
||||
if not args.command:
|
||||
args.command = ['configd actions']
|
||||
|
||||
# execute multiple commands at once ( -m "action1 param .." "action2 param .." )
|
||||
exec_commands=args.command
|
||||
else:
|
||||
# select list command when not otherwise specified
|
||||
if not args.command:
|
||||
args.command = ['configd', 'actions']
|
||||
|
||||
# execute single command sequence
|
||||
exec_commands=[' '.join(args.command)]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user