server crash fix

This commit is contained in:
Neythen Treloar 2022-04-07 19:10:41 +01:00
parent c02eb8b741
commit a38efd3626

View File

@ -60,8 +60,13 @@ ALLOWED_EXTENSIONS = {'csv', 'png'}
ticker = pexpect.spawn("sudo -E python3 stockTicker.py")
time.sleep(2) # give the ticker time to initialise
f = open('csv/system_info.json')
system_info = json.load(f)
f = open('csv/system_info.json', 'w')
try:
system_info = json.load(f)
except:
system_info = {"update_available": False, "first_boot": False}
json.dump(system_info, f)
f.close()
ticker.sendline('*') # run startup gif by default