Skip to content

Commit

Permalink
Ensure fs is synced before reboot so logs aren't lost
Browse files Browse the repository at this point in the history
Signed-off-by: grokbeer <1428380+grokbeer@users.noreply.github.com>
  • Loading branch information
grokbeer committed May 8, 2020
1 parent 05b235c commit 0348881
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pwnagotchi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,11 @@ def reboot(mode=None):
elif mode == 'MANU':
os.system("touch /root/.pwnagotchi-manual")

logging.warning("syncing...")

from pwnagotchi import fs
for m in fs.mounts:
m.sync()

os.system("sync")
os.system("shutdown -r now")

0 comments on commit 0348881

Please sign in to comment.