# pylint: disable=missing-function-docstring,line-too-long,too-many-branches,too-many-statements
+import os
import gzip
import sys
from argparse import ArgumentParser
def parse_cmdline_file(mode: StrOrNone, parsed_options: Dict[str, str], fname: str) -> None:
+ if not os.path.isfile(fname):
+ sys.exit(f'[!] ERROR: unable to open {fname}, are you sure it exists?')
+
with open(fname, 'r', encoding='utf-8') as f:
line = f.readline()
opts = line.split()
def parse_sysctl_file(mode: StrOrNone, parsed_options: Dict[str, str], fname: str) -> None:
+ if not os.path.isfile(fname):
+ sys.exit(f'[!] ERROR: unable to open {fname}, are you sure it exists?')
+
with open(fname, 'r', encoding='utf-8') as f:
sysctl_pattern = re.compile(r"[a-zA-Z0-9/\._-]+ =.*$")
for line in f.readlines():