From 32d244ec6f448d0be8ae6b3a536b54508c2ee9f9 Mon Sep 17 00:00:00 2001 From: Sniffleupagus Date: Sun, 8 Sep 2024 19:25:09 +0100 Subject: [PATCH] add mode parameter to agent._restart, and call agent._restart from USR1 handler instead of pwnagotchi.restart() --- bin/pwnagotchi | 2 +- pwnagotchi/agent.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/pwnagotchi b/bin/pwnagotchi index 234cb374..f6cc89b8 100755 --- a/bin/pwnagotchi +++ b/bin/pwnagotchi @@ -323,7 +323,7 @@ def pwnagotchi_cli(): def usr1_handler(*unused): logging.info('Received USR1 singal. Restart process ...') - restart("MANU" if args.do_manual else "AUTO") + agent._restart("MANU" if args.do_manual else "AUTO") signal.signal(signal.SIGUSR1, usr1_handler) diff --git a/pwnagotchi/agent.py b/pwnagotchi/agent.py index b13fd888..cc3de1f5 100644 --- a/pwnagotchi/agent.py +++ b/pwnagotchi/agent.py @@ -269,9 +269,9 @@ class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer): self._save_recovery_data() pwnagotchi.reboot() - def _restart(self): + def _restart(self, mode='AUTO'): self._save_recovery_data() - pwnagotchi.restart("AUTO") + pwnagotchi.restart(mode) def _save_recovery_data(self): logging.warning("writing recovery data to %s ...", RECOVERY_DATA_FILE)