Fix places where quote replacement lead to issues.
This commit is contained in:
@@ -5,18 +5,18 @@ from typing import Optional
|
||||
|
||||
|
||||
def check_installed() -> bool:
|
||||
'''Check if tcpdump is installed and available on the system path.'''
|
||||
"""Check if tcpdump is installed and available on the system path."""
|
||||
return shutil.which('tcpdump') is not None
|
||||
|
||||
|
||||
def ensure_installed():
|
||||
'''Ensure that tcpdump is installed, raise an error if not.'''
|
||||
"""Ensure that tcpdump is installed, raise an error if not."""
|
||||
if not check_installed():
|
||||
raise RuntimeError('tcpdump is not installed. Please install it to continue.')
|
||||
|
||||
|
||||
def list_interfaces() -> str:
|
||||
'''List available network interfaces using tcpdump.'''
|
||||
"""List available network interfaces using tcpdump."""
|
||||
ensure_installed()
|
||||
try:
|
||||
result = subprocess.run(['tcpdump', '--list-interfaces'], capture_output=True, text=True, check=True)
|
||||
|
||||
Reference in New Issue
Block a user