From 6e8dbaf90ca2523c4c14f30c4cb6bea36a400700 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Wed, 25 Mar 2026 18:20:10 +0100 Subject: [PATCH] Revert "fix(fix_services): merge duplicate pattern handlers 5 and 6" This reverts commit 3962c7573041d4818aaaae7e881b597e779fc02c. --- pwnagotchi/plugins/default/fix_services.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pwnagotchi/plugins/default/fix_services.py b/pwnagotchi/plugins/default/fix_services.py index f8a71d76..3b1078b6 100644 --- a/pwnagotchi/plugins/default/fix_services.py +++ b/pwnagotchi/plugins/default/fix_services.py @@ -244,9 +244,17 @@ class FixServices(plugins.Plugin): except Exception as err: logging.error("[Fix_Services monstart]: %s" % repr(err)) - # Look for patterns 5 or 6 (bettercap crash / Go panic) - elif (self.pattern5.findall(other_other_last_lines) or - self.pattern6.findall(other_other_last_lines)): + # Look for pattern 5 + elif len(self.pattern5.findall(other_other_last_lines)) >= 1: + logging.debug("[Fix_Services] Bettercap has crashed!") + 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!") if hasattr(agent, 'view'): display.set('status', 'Restarting pwnagotchi!')