diff --git a/pwnagotchi/plugins/default/fix_services.py b/pwnagotchi/plugins/default/fix_services.py index e79eb3b2..af265cf4 100644 --- a/pwnagotchi/plugins/default/fix_services.py +++ b/pwnagotchi/plugins/default/fix_services.py @@ -27,10 +27,9 @@ class FixServices(plugins.Plugin): def __init__(self): self.options = dict() - self.pattern = re.compile(r'brcmf_cfg80211_nexmon_set_channel.*?Set Channel failed') - self.pattern2 = re.compile(r'wifi error while hopping to channel') - self.pattern3 = re.compile(r'Firmware has halted or crashed') - self.pattern4 = re.compile(r'error 400: could not find interface wlan0mon') + self.pattern1 = re.compile(r'wifi error while hopping to channel') + self.pattern2 = re.compile(r'Firmware has halted or crashed') + self.pattern3 = re.compile(r'error 400: could not find interface wlan0mon') self.isReloadingMon = False self.connection = None self.LASTTRY = 0 @@ -50,19 +49,7 @@ def on_ready(self, agent): if ",UP," in str(cmd_output): logging.info("wlan0mon is up.") - if len(self.pattern.findall(last_lines)) >= 3: - if hasattr(agent, 'view'): - display = agent.view() - display.set('status', 'Blind-Bug detected. Restarting.') - display.update(force=True) - logging.info('[Fix_Services] Blind-Bug detected. Restarting.') - try: - self._tryTurningItOffAndOnAgain(agent) - except Exception as err: - logging.warning("[Fix_Services turnOffAndOn] %s" % repr(err)) - - else: - logging.info("[Fix_Services] Logs look good!") + logging.info("[Fix_Services] Logs look good!") except Exception as err: logging.error("[Fix_Services ip link show wlan0mon]: %s" % repr(err)) @@ -121,20 +108,7 @@ def on_epoch(self, agent, epoch, epoch_data): logging.debug("[Fix_Services]**** checking") # Look for pattern 1 - if len(self.pattern.findall(last_lines)) >= 3: - logging.debug("[Fix_Services]**** Should trigger a reload of the wlan0mon device:\n%s" % last_lines) - if hasattr(agent, 'view'): - display = agent.view() - display.set('status', 'Blind-Bug detected. Restarting.') - display.update(force=True) - logging.info('[Fix_Services] Blind-Bug detected. Restarting.') - try: - self._tryTurningItOffAndOnAgain(agent) - except Exception as err: - logging.warning("[Fix_Services] TTOAOA: %s" % repr(err)) - - # Look for pattern 2 - elif len(self.pattern2.findall(other_last_lines)) >= 5: + if len(self.pattern1.findall(other_last_lines)) >= 5: logging.debug("[Fix_Services]**** Should trigger a reload of the wlan0mon device:\n%s" % last_lines) if hasattr(agent, 'view'): display = agent.view() @@ -157,8 +131,8 @@ def on_epoch(self, agent, epoch, epoch_data): except Exception as err: logging.error("[Fix_Services wifi.recon flip] %s" % repr(err)) - # Look for pattern 3 - elif len(self.pattern3.findall(other_last_lines)) >= 1: + # Look for pattern 2 + elif len(self.pattern2.findall(other_last_lines)) >= 1: logging.info("[Fix_Services] Firmware has halted or crashed. Restarting wlan0mon.") if hasattr(agent, 'view'): display = agent.view() @@ -171,8 +145,8 @@ def on_epoch(self, agent, epoch, epoch_data): except Exception as err: logging.error("[Fix_Services monstart]: %s" % repr(err)) - # Look for pattern 4 - elif len(self.pattern4.findall(other_other_last_lines)) >= 3: + # Look for pattern 3 + elif len(self.pattern3.findall(other_other_last_lines)) >= 3: logging.info("[Fix_Services] wlan0 is down!") if hasattr(agent, 'view'): display = agent.view()