From 3c678104ef137ff9c913091f79fe29be268517cb Mon Sep 17 00:00:00 2001 From: Troy Stauffer Date: Tue, 1 Jun 2021 22:42:42 -0400 Subject: [PATCH] catches wifi down exception and cycles epoch Signed-off-by: Troy Stauffer --- bin/pwnagotchi | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/pwnagotchi b/bin/pwnagotchi index 55fc22c..aa46229 100755 --- a/bin/pwnagotchi +++ b/bin/pwnagotchi @@ -83,8 +83,13 @@ def do_auto_mode(agent): plugins.on('internet_available', agent) except Exception as e: - logging.exception("main loop exception (%s)", e) - + if str(e).find("wifi.interface not set") > 0: + logging.exception("main loop exception due to unavailable wifi device, likely programmatically disabled (%s)", e) + logging.info("sleeping 60 seconds then advancing to next epoch to allow for cleanup code to trigger") + time.sleep(60) + agent.next_epoch() + else: + logging.exception("main loop exception (%s)", e) if __name__ == '__main__': parser = argparse.ArgumentParser()