diff --git a/pwnagotchi/agent.py b/pwnagotchi/agent.py index 28d9bec4..af9227c4 100644 --- a/pwnagotchi/agent.py +++ b/pwnagotchi/agent.py @@ -277,6 +277,10 @@ class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer): self._save_recovery_data() pwnagotchi.reboot() + def _restart(self): + self._save_recovery_data() + pwnagotchi.restart("AUTO") + def _save_recovery_data(self): logging.warning("writing recovery data to %s ...", RECOVERY_DATA_FILE) with open(RECOVERY_DATA_FILE, 'w') as fp: diff --git a/pwnagotchi/automata.py b/pwnagotchi/automata.py index 25d112a6..9b7f9c8e 100644 --- a/pwnagotchi/automata.py +++ b/pwnagotchi/automata.py @@ -138,6 +138,6 @@ class Automata(object): plugins.on('epoch', self, self._epoch.epoch - 1, self._epoch.data()) if self._epoch.blind_for >= self._config['main']['mon_max_blind_epochs']: - logging.critical("%d epochs without visible access points -> rebooting ...", self._epoch.blind_for) - self._reboot() + logging.critical("%d epochs without visible access points -> restarting ...", self._epoch.blind_for) + self._restart() self._epoch.blind_for = 0