mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
make normalized list appear only when data exists. set magic commands
This commit is contained in:
@ -127,7 +127,7 @@ class info():
|
|||||||
author = 'Kelly Brazil'
|
author = 'Kelly Brazil'
|
||||||
author_email = 'kellyjonbrazil@gmail.com'
|
author_email = 'kellyjonbrazil@gmail.com'
|
||||||
compatible = ['linux']
|
compatible = ['linux']
|
||||||
magic_commands = ['ufw-appinfo']
|
magic_commands = ['ufw app']
|
||||||
|
|
||||||
|
|
||||||
__version__ = info.version
|
__version__ = info.version
|
||||||
@ -172,7 +172,9 @@ def _process(proc_data):
|
|||||||
port_set.update(range(item['start'], item['end'] + 1))
|
port_set.update(range(item['start'], item['end'] + 1))
|
||||||
|
|
||||||
if protocol + '_list' in proc_data:
|
if protocol + '_list' in proc_data:
|
||||||
proc_data['normalized_' + protocol + '_list'] = sorted(set([p for p in proc_data[protocol + '_list'] if p not in port_set]))
|
new_port_list = sorted(set([p for p in proc_data[protocol + '_list'] if p not in port_set]))
|
||||||
|
if new_port_list:
|
||||||
|
proc_data['normalized_' + protocol + '_list'] = new_port_list
|
||||||
|
|
||||||
new_port_ranges = []
|
new_port_ranges = []
|
||||||
state = 'findstart' # 'findstart' or 'findend'
|
state = 'findstart' # 'findstart' or 'findend'
|
||||||
|
Reference in New Issue
Block a user