mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
removed blind bug check from fix_services.py
This commit is contained in:
@ -27,10 +27,9 @@ class FixServices(plugins.Plugin):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.options = dict()
|
self.options = dict()
|
||||||
self.pattern = re.compile(r'brcmf_cfg80211_nexmon_set_channel.*?Set Channel failed')
|
self.pattern1 = re.compile(r'wifi error while hopping to channel')
|
||||||
self.pattern2 = re.compile(r'wifi error while hopping to channel')
|
self.pattern2 = re.compile(r'Firmware has halted or crashed')
|
||||||
self.pattern3 = re.compile(r'Firmware has halted or crashed')
|
self.pattern3 = re.compile(r'error 400: could not find interface wlan0mon')
|
||||||
self.pattern4 = re.compile(r'error 400: could not find interface wlan0mon')
|
|
||||||
self.isReloadingMon = False
|
self.isReloadingMon = False
|
||||||
self.connection = None
|
self.connection = None
|
||||||
self.LASTTRY = 0
|
self.LASTTRY = 0
|
||||||
@ -50,18 +49,6 @@ class FixServices(plugins.Plugin):
|
|||||||
if ",UP," in str(cmd_output):
|
if ",UP," in str(cmd_output):
|
||||||
logging.info("wlan0mon is up.")
|
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:
|
except Exception as err:
|
||||||
@ -121,20 +108,7 @@ class FixServices(plugins.Plugin):
|
|||||||
logging.debug("[Fix_Services]**** checking")
|
logging.debug("[Fix_Services]**** checking")
|
||||||
|
|
||||||
# Look for pattern 1
|
# Look for pattern 1
|
||||||
if len(self.pattern.findall(last_lines)) >= 3:
|
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()
|
|
||||||
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:
|
|
||||||
logging.debug("[Fix_Services]**** Should trigger a reload of the wlan0mon device:\n%s" % last_lines)
|
logging.debug("[Fix_Services]**** Should trigger a reload of the wlan0mon device:\n%s" % last_lines)
|
||||||
if hasattr(agent, 'view'):
|
if hasattr(agent, 'view'):
|
||||||
display = agent.view()
|
display = agent.view()
|
||||||
@ -157,8 +131,8 @@ class FixServices(plugins.Plugin):
|
|||||||
except Exception as err:
|
except Exception as err:
|
||||||
logging.error("[Fix_Services wifi.recon flip] %s" % repr(err))
|
logging.error("[Fix_Services wifi.recon flip] %s" % repr(err))
|
||||||
|
|
||||||
# Look for pattern 3
|
# Look for pattern 2
|
||||||
elif len(self.pattern3.findall(other_last_lines)) >= 1:
|
elif len(self.pattern2.findall(other_last_lines)) >= 1:
|
||||||
logging.info("[Fix_Services] Firmware has halted or crashed. Restarting wlan0mon.")
|
logging.info("[Fix_Services] Firmware has halted or crashed. Restarting wlan0mon.")
|
||||||
if hasattr(agent, 'view'):
|
if hasattr(agent, 'view'):
|
||||||
display = agent.view()
|
display = agent.view()
|
||||||
@ -171,8 +145,8 @@ class FixServices(plugins.Plugin):
|
|||||||
except Exception as err:
|
except Exception as err:
|
||||||
logging.error("[Fix_Services monstart]: %s" % repr(err))
|
logging.error("[Fix_Services monstart]: %s" % repr(err))
|
||||||
|
|
||||||
# Look for pattern 4
|
# Look for pattern 3
|
||||||
elif len(self.pattern4.findall(other_other_last_lines)) >= 3:
|
elif len(self.pattern3.findall(other_other_last_lines)) >= 3:
|
||||||
logging.info("[Fix_Services] wlan0 is down!")
|
logging.info("[Fix_Services] wlan0 is down!")
|
||||||
if hasattr(agent, 'view'):
|
if hasattr(agent, 'view'):
|
||||||
display = agent.view()
|
display = agent.view()
|
||||||
|
Reference in New Issue
Block a user