Merge pull request #535 from CoderFX/fix/fix-services-lasttry-update

fix(fix_services): update LASTTRY cooldown after pattern matches
This commit is contained in:
Jayofelony
2026-03-11 07:21:06 +01:00
committed by GitHub

View File

@@ -169,6 +169,7 @@ class FixServices(plugins.Plugin):
logging.debug("[Fix_Services]**** checking")
if len(self.pattern.findall(last_lines)) >= 1:
self.LASTTRY = time.time()
subprocess.check_output("monstop", shell=True)
subprocess.check_output("monstart", shell=True)
display.set('status', 'Wifi channel stuck. Restarting recon.')
@@ -177,6 +178,7 @@ class FixServices(plugins.Plugin):
# Look for pattern 2
elif len(self.pattern2.findall(other_last_lines)) >= 5:
self.LASTTRY = time.time()
logging.debug("[Fix_Services]**** Should trigger a reload of the wlan0mon device:\n%s" % last_lines)
if hasattr(agent, 'view'):
display.set('status', 'Wifi channel stuck. Restarting recon.')
@@ -200,6 +202,7 @@ class FixServices(plugins.Plugin):
# Look for pattern 3
elif len(self.pattern3.findall(other_last_lines)) >= 1:
self.LASTTRY = time.time()
logging.debug("[Fix_Services] Firmware has halted or crashed. Restarting wlan0mon.")
if hasattr(agent, 'view'):
display.set('status', 'Firmware has halted or crashed. Restarting wlan0mon.')
@@ -213,6 +216,7 @@ class FixServices(plugins.Plugin):
# Look for pattern 4
elif len(self.pattern4.findall(other_other_last_lines)) >= 3:
self.LASTTRY = time.time()
logging.debug("[Fix_Services] wlan0 is down!")
if hasattr(agent, 'view'):
display.set('status', 'Restarting wlan0 now!')
@@ -244,6 +248,7 @@ class FixServices(plugins.Plugin):
# Look for pattern 7
elif len(self.pattern7.findall(other_other_last_lines)) >= 1:
self.LASTTRY = time.time()
logging.debug("[Fix_Services] Monitor mode failed!")
try:
result = agent.run("wifi.recon off; wifi.recon on")