Merge pull request #874 from grokbeer/reboot-sync

Ensure fs is synced before reboot so logs aren't lost
This commit is contained in:
Simone Margaritelli 2020-06-26 14:14:03 +02:00 committed by GitHub
commit f7cf4b3947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")