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: