mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Merge pull request #872 from grokbeer/shutdown-sync
Delaying fs sync to ensure shutdown message is logged to disk
This commit is contained in:
@ -106,12 +106,6 @@ def temperature(celsius=True):
|
|||||||
|
|
||||||
|
|
||||||
def shutdown():
|
def shutdown():
|
||||||
logging.warning("syncing...")
|
|
||||||
|
|
||||||
from pwnagotchi import fs
|
|
||||||
for m in fs.mounts:
|
|
||||||
m.sync()
|
|
||||||
|
|
||||||
logging.warning("shutting down ...")
|
logging.warning("shutting down ...")
|
||||||
|
|
||||||
from pwnagotchi.ui import view
|
from pwnagotchi.ui import view
|
||||||
@ -119,6 +113,13 @@ def shutdown():
|
|||||||
view.ROOT.on_shutdown()
|
view.ROOT.on_shutdown()
|
||||||
# give it some time to refresh the ui
|
# give it some time to refresh the ui
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
|
logging.warning("syncing...")
|
||||||
|
|
||||||
|
from pwnagotchi import fs
|
||||||
|
for m in fs.mounts:
|
||||||
|
m.sync()
|
||||||
|
|
||||||
os.system("sync")
|
os.system("sync")
|
||||||
os.system("halt")
|
os.system("halt")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user