Commit 5366b2b8 authored by Ad Schellevis's avatar Ad Schellevis

(configd/legacy) align result of "filter list osfp"

parent 57317188
......@@ -31,6 +31,7 @@
import tempfile
import subprocess
import os
import sys
import ujson
result=[]
......@@ -42,4 +43,11 @@ with tempfile.NamedTemporaryFile() as output_stream:
for line in data.split('\n')[2:]:
result.append(line.replace('\t',' ').strip())
print(ujson.dumps(result))
# handle command line argument (type selection)
if len(sys.argv) > 1 and sys.argv[1] == 'json':
print(ujson.dumps(result))
else:
# output plain
print ('------------------------- OS fingerprints -------------------------')
for ostype in result:
print (ostype)
......@@ -18,7 +18,7 @@ message:refresh url table aliasses
[list.osfp]
command:/usr/local/opnsense/scripts/filter/list_osfp.py
parameters:
parameters: %s
type:script_output
message:request osfp
......
......@@ -36,7 +36,7 @@ require_once("interfaces.inc");
$tcpflags = array("syn", "ack", "fin", "rst", "psh", "urg", "ece", "cwr");
/* OS types, request from backend */
$ostypes = json_decode(configd_run('filter list osfp'));
$ostypes = json_decode(configd_run('filter list osfp json'));
/**
* build array with interface options for this form
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment