mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-03 15:56:17 +00:00
Adjust version to v4.0.2
This commit is contained in:
58
src/wgd.sh
58
src/wgd.sh
@@ -337,28 +337,42 @@ start_wgd_debug() {
|
||||
}
|
||||
|
||||
update_wgd() {
|
||||
new_ver=$($venv_python -c "import json; import urllib.request; data = urllib.request.urlopen('https://api.github.com/repos/donaldzou/WGDashboard/releases/latest').read(); output = json.loads(data);print(output['tag_name'])")
|
||||
printf "%s\n" "$dashes"
|
||||
printf "[WGDashboard] Are you sure you want to update to the %s? (Y/N): " "$new_ver"
|
||||
read up
|
||||
if [ "$up" = "Y" ] || [ "$up" = "y" ]; then
|
||||
printf "[WGDashboard] Shutting down WGDashboard\n"
|
||||
if check_wgd_status; then
|
||||
stop_wgd
|
||||
fi
|
||||
mv wgd.sh wgd.sh.old
|
||||
printf "[WGDashboard] Downloading %s from GitHub..." "$new_ver"
|
||||
{ date; git stash; git pull https://github.com/donaldzou/WGDashboard.git $new_ver --force; } >> ./log/update.txt
|
||||
chmod +x ./wgd.sh
|
||||
sudo ./wgd.sh install
|
||||
printf "[WGDashboard] Update completed!\n"
|
||||
printf "%s\n" "$dashes"
|
||||
rm wgd.sh.old
|
||||
else
|
||||
printf "%s\n" "$dashes"
|
||||
printf "| Update Canceled. |\n"
|
||||
printf "%s\n" "$dashes"
|
||||
fi
|
||||
|
||||
_determineOS
|
||||
if ! python3 --version > /dev/null 2>&1
|
||||
then
|
||||
printf "[WGDashboard] Python is not installed, trying to install now\n"
|
||||
_installPython
|
||||
else
|
||||
printf "[WGDashboard] %s Python is installed\n" "$heavy_checkmark"
|
||||
fi
|
||||
|
||||
_checkPythonVersion
|
||||
_installPythonVenv
|
||||
_installPythonPip
|
||||
|
||||
new_ver=$($venv_python -c "import json; import urllib.request; data = urllib.request.urlopen('https://api.github.com/repos/donaldzou/WGDashboard/releases/latest').read(); output = json.loads(data);print(output['tag_name'])")
|
||||
printf "%s\n" "$dashes"
|
||||
printf "[WGDashboard] Are you sure you want to update to the %s? (Y/N): " "$new_ver"
|
||||
read up
|
||||
if [ "$up" = "Y" ] || [ "$up" = "y" ]; then
|
||||
printf "[WGDashboard] Shutting down WGDashboard\n"
|
||||
if check_wgd_status; then
|
||||
stop_wgd
|
||||
fi
|
||||
mv wgd.sh wgd.sh.old
|
||||
printf "[WGDashboard] Downloading %s from GitHub..." "$new_ver"
|
||||
{ date; git stash; git pull https://github.com/donaldzou/WGDashboard.git $new_ver --force; } >> ./log/update.txt
|
||||
chmod +x ./wgd.sh
|
||||
sudo ./wgd.sh install
|
||||
printf "[WGDashboard] Update completed!\n"
|
||||
printf "%s\n" "$dashes"
|
||||
rm wgd.sh.old
|
||||
else
|
||||
printf "%s\n" "$dashes"
|
||||
printf "[WGDashboard] Update Canceled.\n"
|
||||
printf "%s\n" "$dashes"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$#" != 1 ];
|
||||
|
Reference in New Issue
Block a user