mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-22 07:10:09 +01:00
Update wgd.sh
This commit is contained in:
parent
6c87812780
commit
2e691d7c26
20
src/wgd.sh
20
src/wgd.sh
@ -2,7 +2,7 @@
|
||||
|
||||
# wgd.sh - Copyright(C) 2024 Donald Zou [https://github.com/donaldzou]
|
||||
# Under Apache-2.0 License
|
||||
trap "kill -s $TOP_PID"
|
||||
trap "kill $TOP_PID"
|
||||
export TOP_PID=$$
|
||||
|
||||
app_name="dashboard.py"
|
||||
@ -53,7 +53,7 @@ _check_and_set_venv(){
|
||||
if ! $venv_python --version > /dev/null 2>&1
|
||||
then
|
||||
printf "[WGDashboard] %s Python Virtual Environment under ./venv failed to create. Halting now.\n" "$heavy_crossmark"
|
||||
kill -s $TOP_PID
|
||||
kill $TOP_PID
|
||||
fi
|
||||
|
||||
. ${VIRTUAL_ENV}/bin/activate
|
||||
@ -70,7 +70,7 @@ _determineOS(){
|
||||
else
|
||||
printf "[WGDashboard] %s Sorry, your OS is not supported. Currently the install script only support Debian-based, Red Hat-based OS." "$heavy_crossmark"
|
||||
printf "%s\n" "$helpMsg"
|
||||
kill -s $TOP_PID
|
||||
kill $TOP_PID
|
||||
fi
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ _installPython(){
|
||||
then
|
||||
printf "[WGDashboard] %s Python is still not installed, halting script now.\n" "$heavy_crossmark"
|
||||
printf "%s\n" "$helpMsg"
|
||||
kill -s $TOP_PID
|
||||
kill $TOP_PID
|
||||
else
|
||||
printf "[WGDashboard] %s Python is installed\n" "$heavy_checkmark"
|
||||
fi
|
||||
@ -114,7 +114,7 @@ _installPythonVenv(){
|
||||
*)
|
||||
printf "[WGDashboard] %s Sorry, your OS is not supported. Currently the install script only support Debian-based, Red Hat-based OS." "$heavy_crossmark"
|
||||
printf "%s\n" "$helpMsg"
|
||||
kill -s $TOP_PID
|
||||
kill $TOP_PID
|
||||
;;
|
||||
esac
|
||||
else
|
||||
@ -152,7 +152,7 @@ _installPythonPip(){
|
||||
*)
|
||||
printf "[WGDashboard] Sorry, your OS is not support auto install. Currently the install script only support Debian-based, Red Hat-based OS."
|
||||
printf "%s\n" "$helpMsg"
|
||||
kill -s $TOP_PID
|
||||
kill $TOP_PID
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
@ -161,7 +161,7 @@ _installPythonPip(){
|
||||
then
|
||||
printf "[WGDashboard] %s Python Package Manager (PIP) is still not installed, halting script now.\n" "$heavy_crossmark"
|
||||
printf "%s\n" "$helpMsg"
|
||||
kill -s $TOP_PID
|
||||
kill $TOP_PID
|
||||
else
|
||||
printf "[WGDashboard] %s Python Package Manager (PIP) is installed\n" "$heavy_checkmark"
|
||||
fi
|
||||
@ -171,12 +171,12 @@ _checkWireguard(){
|
||||
if ! wg -h > /dev/null 2>&1
|
||||
then
|
||||
printf "[WGDashboard] %s WireGuard is not installed. Please follow instruction on https://www.wireguard.com/install/ to install. \n" "$heavy_crossmark"
|
||||
kill -s $TOP_PID
|
||||
kill $TOP_PID
|
||||
fi
|
||||
if ! wg-quick -h > /dev/null 2>&1
|
||||
then
|
||||
printf "[WGDashboard] %s WireGuard is not installed. Please follow instruction on https://www.wireguard.com/install/ to install. \n" "$heavy_crossmark"
|
||||
kill -s $TOP_PID
|
||||
kill $TOP_PID
|
||||
fi
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ _checkPythonVersion(){
|
||||
else
|
||||
printf "[WGDashboard] %s Could not find a compatible version of Python. Current Python is %s.\n" "$heavy_crossmark" "$version"
|
||||
printf "[WGDashboard] WGDashboard required Python 3.10, 3.11 or 3.12. Halting install now.\n"
|
||||
kill -s $TOP_PID
|
||||
kill $TOP_PID
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user