filter-list_counters skip empty lines, for https://github.com/opnsense/core/issues/3798

This commit is contained in:
Ad Schellevis 2019-11-07 09:26:45 +01:00
parent 8a83b3bb12
commit 196d462383
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ if __name__ == '__main__':
sp = subprocess.run(['/sbin/pfctl', '-vvsI'], capture_output=True, text=True)
intf = None
for line in sp.stdout.strip().split('\n'):
if line.find('[') == -1 and line[0] not in (' ', '\t'):
if line.find('[') == -1 and len(line) > 0 and line[0] not in (' ', '\t'):
intf = line.strip()
result[intf] = {'inbytespass': 0, 'outbytespass': 0, 'inpktspass': 0, 'outpktspass': 0,
'inbytesblock': 0, 'outbytesblock': 0, 'inpktsblock': 0, 'outpktsblock': 0,