mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
(configd/legacy) align result of "filter list osfp"
This commit is contained in:
parent
57317188fd
commit
5366b2b898
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user