mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2026-04-28 09:53:06 -07:00
Merge pull request #526
fix(fix_services): merge duplicate pattern handlers 5 and 6
This commit is contained in:
@@ -228,17 +228,9 @@ 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
|
# Look for patterns 5 or 6 (bettercap crash / Go panic)
|
||||||
elif len(self.pattern5.findall(other_other_last_lines)) >= 1:
|
elif (self.pattern5.findall(other_other_last_lines) or
|
||||||
logging.debug("[Fix_Services] Bettercap has crashed!")
|
self.pattern6.findall(other_other_last_lines)):
|
||||||
if hasattr(agent, 'view'):
|
|
||||||
display.set('status', 'Restarting pwnagotchi!')
|
|
||||||
display.update(force=True)
|
|
||||||
subprocess.run(["systemctl", "restart", "bettercap"], timeout=30)
|
|
||||||
pwnagotchi.restart("AUTO")
|
|
||||||
|
|
||||||
# Look for pattern 6
|
|
||||||
elif len(self.pattern6.findall(other_other_last_lines)) >= 1:
|
|
||||||
logging.debug("[Fix_Services] Bettercap has crashed!")
|
logging.debug("[Fix_Services] Bettercap has crashed!")
|
||||||
if hasattr(agent, 'view'):
|
if hasattr(agent, 'view'):
|
||||||
display.set('status', 'Restarting pwnagotchi!')
|
display.set('status', 'Restarting pwnagotchi!')
|
||||||
|
|||||||
Reference in New Issue
Block a user