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

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

parent 57317188
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
import tempfile import tempfile
import subprocess import subprocess
import os import os
import sys
import ujson import ujson
result=[] result=[]
...@@ -42,4 +43,11 @@ with tempfile.NamedTemporaryFile() as output_stream: ...@@ -42,4 +43,11 @@ with tempfile.NamedTemporaryFile() as output_stream:
for line in data.split('\n')[2:]: for line in data.split('\n')[2:]:
result.append(line.replace('\t',' ').strip()) 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 ...@@ -18,7 +18,7 @@ message:refresh url table aliasses
[list.osfp] [list.osfp]
command:/usr/local/opnsense/scripts/filter/list_osfp.py command:/usr/local/opnsense/scripts/filter/list_osfp.py
parameters: parameters: %s
type:script_output type:script_output
message:request osfp message:request osfp
......
...@@ -36,7 +36,7 @@ require_once("interfaces.inc"); ...@@ -36,7 +36,7 @@ require_once("interfaces.inc");
$tcpflags = array("syn", "ack", "fin", "rst", "psh", "urg", "ece", "cwr"); $tcpflags = array("syn", "ack", "fin", "rst", "psh", "urg", "ece", "cwr");
/* OS types, request from backend */ /* 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 * 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