From fcf9300a4924b7cb2b8b98a9b0b2cc943d0ebc89 Mon Sep 17 00:00:00 2001 From: Donald Cheng Hong Zou Date: Sat, 25 Dec 2021 17:35:36 -0500 Subject: [PATCH] Update wgd.sh --- src/wgd.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/wgd.sh b/src/wgd.sh index 68473b4..9593721 100755 --- a/src/wgd.sh +++ b/src/wgd.sh @@ -33,7 +33,6 @@ _check_and_set_venv(){ install_wgd(){ # Check Python3 version - printf "%s\n" "$dashes" printf "| Starting to install WGDashboard |\n" version_pass=$(python3 -c 'import sys; print("1") if (sys.version_info.major == 3 and sys.version_info.minor >= 7) else print("0");') if [ $version_pass == "0" ] @@ -64,9 +63,7 @@ install_wgd(){ # printf "| Consider 'systemctl enable wg-dashboard' |\n" # printf " and 'systemctl start wg-dashboard'\n" # printf " use '${0} stop' before starting with systemctl\n" - echo - printf "| Now starting Dashboard in background |\n" - start_wgd + printf "| Enter ./wgd start to start the dashboard |\n" } @@ -80,7 +77,6 @@ check_wgd_status(){ } start_wgd () { -# _check_and_set_venv printf "%s\n" "$dashes" printf "| Starting WGDashboard in the background. |\n" if [ ! -d "log" ] @@ -98,7 +94,6 @@ stop_wgd() { start_wgd_debug() { printf "%s\n" "$dashes" -# _check_and_set_venv printf "| Starting WGDashboard in the foreground. |\n" python3 "$app_name" printf "%s\n" "$dashes" @@ -115,12 +110,14 @@ update_wgd() { mv wgd.sh wgd.sh.old printf "| Downloading %s from GitHub... |\n" "$new_ver" git stash > /dev/null 2>&1 - git pull https://github.com/donaldzou/wireguard-dashboard.git $new_ver --force > /dev/null 2>&1 - printf "| Installing latest Python dependencies |\n" - python3 -m pip install -U -r requirements.txt > /dev/null 2>&1 - printf "| Update Successfully! |\n" - rm wgd.sh.old +# git pull https://github.com/donaldzou/wireguard-dashboard.git $new_ver --force > /dev/null 2>&1 +# printf "| Installing latest Python dependencies |\n" +# python3 -m pip install -U -r requirements.txt > /dev/null 2>&1 +# printf "| Update Successfully! |\n" + install_wgd printf "| Enter ./wgd start to start the dashboard |\n" + printf "%s\n" "$dashes" + rm wgd.sh.old else printf "%s\n" "$dashes" printf "| Update Canceled. |\n" @@ -155,7 +152,9 @@ if [ "$#" != 1 ]; elif [ "$1" = "update" ]; then update_wgd elif [ "$1" = "install" ]; then + printf "%s\n" "$dashes" install_wgd + printf "%s\n" "$dashes" elif [ "$1" = "restart" ]; then if check_wgd_status; then printf "%s\n" "$dashes"