From 868e7da834e14b968c6364cf5e3c0309d5f1c2da Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 7 Jan 2024 14:23:10 +0100 Subject: [PATCH] Update --- pwnagotchi/__init__.py | 1 + pwnagotchi/bettercap.py | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pwnagotchi/__init__.py b/pwnagotchi/__init__.py index b2dc167f..5c4d9637 100644 --- a/pwnagotchi/__init__.py +++ b/pwnagotchi/__init__.py @@ -136,6 +136,7 @@ def restart(mode): os.system("touch /root/.pwnagotchi-manual") os.system("service bettercap restart") + time.sleep(1) os.system("service pwnagotchi restart") diff --git a/pwnagotchi/bettercap.py b/pwnagotchi/bettercap.py index 961834e3..5d24c21e 100644 --- a/pwnagotchi/bettercap.py +++ b/pwnagotchi/bettercap.py @@ -102,9 +102,7 @@ class Client(object): except OSError: sleep_time = min_sleep + max_sleep * random.random() logging.warning('connection to the bettercap endpoint failed...') - logging.warning('retrying connection in {} sec'.format(sleep_time)) - await asyncio.sleep(sleep_time) - continue + pwnagotchi.restart("AUTO") def run(self, command, verbose_errors=True): while True: