Compare commits

..

2 Commits

Author SHA1 Message Date
Donald Cheng Hong Zou
0a92269456 v2.0-beta-6 Commit 2021-05-13 18:47:59 -04:00
Donald Cheng Hong Zou
1cb8906893 v2.0-beta-6 Commit 2021-05-13 18:21:10 -04:00
2 changed files with 7 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ import ifcfg
from tinydb import TinyDB, Query
# Dashboard Version
dashboard_version = 'v2.0.1'
dashboard_version = 'v2.0'
# Dashboard Config Name
dashboard_conf = 'wg-dashboard.ini'
# Upgrade Required
@@ -633,7 +633,10 @@ def check_update():
conf.read(dashboard_conf)
data = urllib.request.urlopen("https://api.github.com/repos/donaldzou/wireguard-dashboard/releases").read()
output = json.loads(data)
if conf.get("Server", "version") == output[0]["tag_name"]:
release = []
for i in output:
if i["prerelease"] == False: release.append(i)
if conf.get("Server", "version") == release[0]["tag_name"]:
return "false"
else:
return "true"

View File

@@ -56,7 +56,8 @@ update_wgd() {
printf "| Installing all required python package |\n"
python3 -m pip install -r requirements.txt
printf "| Update Successfully! |\n"
printf "| Now you can start the dashboard with >> sh wgd.sh start |\n"
printf "| Dashboard is running... |\n"
exec "wgd.sh" "start"
exit 1
else
printf "Cancel update. \n"