mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
@ -38,6 +38,7 @@ class FixServices(plugins.Plugin):
|
|||||||
self.pattern2 = re.compile(r'wifi error while hopping to channel')
|
self.pattern2 = re.compile(r'wifi error while hopping to channel')
|
||||||
self.pattern3 = re.compile(r'Firmware has halted or crashed')
|
self.pattern3 = re.compile(r'Firmware has halted or crashed')
|
||||||
self.pattern4 = re.compile(r'error 400: could not find interface wlan0mon')
|
self.pattern4 = re.compile(r'error 400: could not find interface wlan0mon')
|
||||||
|
self.pattern5 = re.compile(r'waiting for bettercap API to be available')
|
||||||
self.isReloadingMon = False
|
self.isReloadingMon = False
|
||||||
self.connection = None
|
self.connection = None
|
||||||
self.LASTTRY = 0
|
self.LASTTRY = 0
|
||||||
@ -192,6 +193,19 @@ 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 5
|
||||||
|
elif len(self.pattern5.findall(other_other_last_lines)) >= 8:
|
||||||
|
logging.info("[Fix_Services] bettercap is down, restarting!")
|
||||||
|
if hasattr(agent, 'view'):
|
||||||
|
display = agent.view()
|
||||||
|
display.set('status', 'Rebooting now!')
|
||||||
|
display.update(force=True)
|
||||||
|
try:
|
||||||
|
logging.info("[Fix_Services rebooting now]")
|
||||||
|
pwnagotchi.reboot()
|
||||||
|
except Exception as err:
|
||||||
|
logging.error("[Fix_Services monstart]: %s" % repr(err))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("logs look good")
|
print("logs look good")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user