update flag switched on update

This commit is contained in:
Neythen Treloar 2022-03-08 17:00:51 +00:00
parent 03b5ace715
commit 2dd4ab60ee

View File

@ -131,6 +131,7 @@ def index():
GIF_settings = json.load(open('csv/GIF_settings.json', 'r'))
message_settings = json.load(open('csv/message_settings.json', 'r'))
general_settings = json.load(open('csv/general_settings.json', 'r'))
system_info = json.load(open('csv/system_info.json', 'r'))
try: # incase this doesnt exist
api_keys = api_key2[1]
except:
@ -262,6 +263,10 @@ def stop():
@app.route("/update", methods=['PUT','POST'])
def update():
system_info = json.load(open('csv/system_info.json', 'r'))
system_info["update_available"] = False
json.dump(system_info, open('csv/system_info.json', 'w+'))
os.system("./update.sh")
os.system("sudo reboot now")
return index()