Skip to content

Commit

Permalink
Merge pull request #1003 from troystauffer/master
Browse files Browse the repository at this point in the history
catches wifi down exception and cycles epoch
  • Loading branch information
evilsocket authored Jun 4, 2021
2 parents 5ec621c + 3c67810 commit a5d5533
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/pwnagotchi
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a5d5533

Please sign in to comment.