check update added

This commit is contained in:
Neythen Treloar
2022-02-27 09:52:37 +00:00
parent 21f28e0977
commit dfe068591a
3 changed files with 17 additions and 5 deletions

2
csv/system_info.json Executable file → Normal file
View File

@@ -1 +1 @@
{"update_available": false, "first_boot": true}
{"update_available": false, "first_boot": false}

View File

@@ -26,7 +26,7 @@ import urllib.request
#open('log.txt', 'w').close() #wipe logs
os.system("sudo ./check_update.sh")
#api_caller = pexpect.spawn("sudo -E taskset -c 3 python3 api_caller.py")
api_caller = pexpect.spawn("sudo -E taskset -c 3 python3 database_caller.py")
api_caller.sendline('A')
@@ -121,6 +121,7 @@ def index():
templateData = {
'system_info':system_info,
'currently_displaying': currently_displaying,
'not_displaying': not_displaying,
'stocks_settings': stocks_settings,
@@ -235,8 +236,13 @@ def stop():
@app.route("/update", methods=['PUT','POST'])
def update():
os.system("./update.sh")
os.system("sudo reboot now")
uptodate = os.system('sudo ./check_update.sh')
print('python:', uptodate)
print(uptodate == 'not up to date')
print(uptodate == 'up to date')
#os.system("./update.sh")
#os.system("sudo reboot now")
return index()
@app.route("/restart")

View File

@@ -52,7 +52,13 @@
<link
rel="stylesheet"
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/fontawesome.min.css"
integrity="sha512-kJ30H6g4NGhWopgdseRb8wTsyllFUYIx3hiUwmGAkgA9B/JbzUBDQVr2VVlWGde6sdBVOG7oU8AL35ORDuMm8g=="
crossorigin="anonymous"
/>