mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Check for mq before attempting to delete https://github.com/LibreQoE/LibreQoS/issues/228
This commit is contained in:
@@ -46,17 +46,14 @@ def shell(command):
|
|||||||
else:
|
else:
|
||||||
logging.info(command)
|
logging.info(command)
|
||||||
|
|
||||||
def shellTC(command):
|
def shellReturn(command):
|
||||||
|
returnableString = ''
|
||||||
if enableActualShellCommands:
|
if enableActualShellCommands:
|
||||||
print(command)
|
|
||||||
commands = command.split(' ')
|
commands = command.split(' ')
|
||||||
proc = subprocess.Popen(commands, stdout=subprocess.PIPE)
|
proc = subprocess.Popen(commands, stdout=subprocess.PIPE)
|
||||||
for line in io.TextIOWrapper(proc.stdout, encoding="utf-8"): # or another encoding
|
for line in io.TextIOWrapper(proc.stdout, encoding="utf-8"): # or another encoding
|
||||||
if logging.DEBUG <= logging.root.level:
|
returnableString = returnableString + line + '\n'
|
||||||
print(line)
|
return returnableString
|
||||||
if ("RTNETLINK answers" in line) or ("We have an error talking to the kernel" in line):
|
|
||||||
warnings.warn("Command: '" + command + "' resulted in " + line, stacklevel=2)
|
|
||||||
raise SystemError("Command: '" + command + "' resulted in " + line)
|
|
||||||
|
|
||||||
def checkIfFirstRunSinceBoot():
|
def checkIfFirstRunSinceBoot():
|
||||||
if os.path.isfile("lastRun.txt"):
|
if os.path.isfile("lastRun.txt"):
|
||||||
@@ -75,14 +72,14 @@ def checkIfFirstRunSinceBoot():
|
|||||||
|
|
||||||
def clearPriorSettings(interfaceA, interfaceB):
|
def clearPriorSettings(interfaceA, interfaceB):
|
||||||
if enableActualShellCommands:
|
if enableActualShellCommands:
|
||||||
# Clear tc filter
|
if 'mq' in shellReturn('tc qdisc show dev ' + interfaceA + ' root'):
|
||||||
if OnAStick == True:
|
print('MQ detected. Will delete and recreate mq qdisc.')
|
||||||
shell('tc qdisc delete dev ' + interfaceA + ' root')
|
# Clear tc filter
|
||||||
else:
|
if OnAStick == True:
|
||||||
shell('tc qdisc delete dev ' + interfaceA + ' root')
|
shell('tc qdisc delete dev ' + interfaceA + ' root')
|
||||||
shell('tc qdisc delete dev ' + interfaceB + ' root')
|
else:
|
||||||
#shell('tc qdisc delete dev ' + interfaceA)
|
shell('tc qdisc delete dev ' + interfaceA + ' root')
|
||||||
#shell('tc qdisc delete dev ' + interfaceB)
|
shell('tc qdisc delete dev ' + interfaceB + ' root')
|
||||||
|
|
||||||
def tearDown(interfaceA, interfaceB):
|
def tearDown(interfaceA, interfaceB):
|
||||||
# Full teardown of everything for exiting LibreQoS
|
# Full teardown of everything for exiting LibreQoS
|
||||||
|
|||||||
Reference in New Issue
Block a user