From dfe068591aa498afb221060336043bd753563c21 Mon Sep 17 00:00:00 2001
From: Neythen Treloar
Date: Sun, 27 Feb 2022 09:52:37 +0000
Subject: [PATCH] check update added
---
csv/system_info.json | 2 +-
server.py | 12 +++++++++---
templates/index.html | 8 +++++++-
3 files changed, 17 insertions(+), 5 deletions(-)
mode change 100755 => 100644 csv/system_info.json
diff --git a/csv/system_info.json b/csv/system_info.json
old mode 100755
new mode 100644
index 02cf3e9..09cbb60
--- a/csv/system_info.json
+++ b/csv/system_info.json
@@ -1 +1 @@
-{"update_available": false, "first_boot": true}
+{"update_available": false, "first_boot": false}
diff --git a/server.py b/server.py
index 34cd0cf..961aeb6 100755
--- a/server.py
+++ b/server.py
@@ -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")
diff --git a/templates/index.html b/templates/index.html
index ad84b59..578591b 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -52,7 +52,13 @@
-
+