Ensure fs is synced before reboot so logs aren't lost

Signed-off-by: grokbeer <1428380+grokbeer@users.noreply.github.com>
This commit is contained in:
grokbeer 2020-05-08 21:57:08 +12:00
parent 05b235c38b
commit 03488819af

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