firewall/live-log, when changing the optimisation mode the line numbers don't seem to add up any more. Previously we used to parse the pf config to show our rules, it looks safer to use the actual running config using -vvPsr

ref https://forum.opnsense.org/index.php?topic=13308.0
This commit is contained in:
Ad Schellevis 2019-06-29 15:29:04 +02:00
parent 6b6e3ed32d
commit 1d1ce841ff

View File

@ -86,7 +86,7 @@ def fetch_rule_details():
# use pfctl to create a list per rule number with the details found
with tempfile.NamedTemporaryFile() as output_stream:
subprocess.call(['/sbin/pfctl', '-vvPnf', '/tmp/rules.debug'],
subprocess.call(['/sbin/pfctl', '-vvPsr'],
stdout=output_stream, stderr=open(os.devnull, 'wb'))
output_stream.seek(0)
for line in output_stream.read().decode().strip().split('\n'):