mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-23 00:29:59 +02:00
handle bluetooth section (ignore for now)
This commit is contained in:
@ -313,7 +313,7 @@ import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
version = '1.3'
|
||||
version = '1.4'
|
||||
description = 'netstat command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@ -536,6 +536,7 @@ def parse(data, raw=False, quiet=False):
|
||||
raw_output = []
|
||||
network = False
|
||||
socket = False
|
||||
bluetooth = False
|
||||
headers = ''
|
||||
network_list = []
|
||||
socket_list = []
|
||||
@ -546,12 +547,20 @@ def parse(data, raw=False, quiet=False):
|
||||
network_list = []
|
||||
network = True
|
||||
socket = False
|
||||
bluetooth = False
|
||||
continue
|
||||
|
||||
if line.startswith('Active UNIX'):
|
||||
socket_list = []
|
||||
network = False
|
||||
socket = True
|
||||
bluetooth = False
|
||||
continue
|
||||
|
||||
if line.startswith('Active Bluetooth'):
|
||||
network = False
|
||||
socket = False
|
||||
bluetooth = True
|
||||
continue
|
||||
|
||||
if line.startswith('Proto'):
|
||||
@ -567,6 +576,10 @@ def parse(data, raw=False, quiet=False):
|
||||
socket_list.append(parse_socket(header_text, headers, line))
|
||||
continue
|
||||
|
||||
if bluetooth:
|
||||
# maybe implement later if requested
|
||||
continue
|
||||
|
||||
for item in [network_list, socket_list]:
|
||||
for entry in item:
|
||||
raw_output.append(entry)
|
||||
|
Reference in New Issue
Block a user