]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
suricatasc: exit with error if command returns NOK 1252/head
authorEric Leblond <eric@regit.org>
Fri, 12 Dec 2014 09:10:46 +0000 (10:10 +0100)
committerEric Leblond <eric@regit.org>
Fri, 12 Dec 2014 09:13:16 +0000 (10:13 +0100)
scripts/suricatasc/suricatasc.in

index ea00f09380d7874bc3811cccf9575e357265419e..4b44204bcf500ba577f3d1838c4f652579f00506 100755 (executable)
@@ -41,9 +41,13 @@ except SuricataReturnException as err:
 
 if args.command:
     (command, arguments) = sc.parse_command(args.command)
-    print(sc.send_command(command, arguments))
+    res = sc.send_command(command, arguments)
+    print(res)
     sc.close()
-    sys.exit(0)
+    if res['return'] == 'OK':
+        sys.exit(0)
+    else:
+        sys.exit(1)
 
 try:
     sc.interactive()