mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Rename script, prompt user to apply if they didn't pass --apply
This commit is contained in:
@@ -37,9 +37,18 @@ def print_err(string: str):
|
|||||||
|
|
||||||
|
|
||||||
def check_apply(args: dict):
|
def check_apply(args: dict):
|
||||||
|
cmd_arr = ['salt-call', 'state.apply', 'idstools', 'queue=True']
|
||||||
|
|
||||||
if args.apply:
|
if args.apply:
|
||||||
print('Applying idstools state...')
|
print('Applying idstools state...')
|
||||||
return subprocess.run(['salt-call', 'state.apply', 'idstools', 'queue=True'])
|
return subprocess.run(cmd_arr)
|
||||||
|
else:
|
||||||
|
message = 'Would you like to apply your changes now? (y/N) '
|
||||||
|
answer = input(message)
|
||||||
|
while answer.lower() not in [ 'y', 'n', '' ]:
|
||||||
|
answer = input(message)
|
||||||
|
if answer.lower() in [ 'n', '' ]:
|
||||||
|
return subprocess.run(cmd_arr)
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
Reference in New Issue
Block a user