From 3d046e43696d20693617cf0108325174ae92e811 Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Fri, 16 Aug 2024 02:40:25 -0400 Subject: [PATCH] Update wgd.sh --- src/wgd.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/wgd.sh b/src/wgd.sh index e45a58a..0cc03e2 100755 --- a/src/wgd.sh +++ b/src/wgd.sh @@ -132,7 +132,23 @@ _installPythonPip(){ if ! $pythonExecutable -m pip -h > /dev/null 2>&1 then - { $pythonExecutable -m ensurepip --default-pip; printf "\n\n"; } &>> ./log/install.txt + case "$OS" in + ubuntu|debian) + { sudo apt update ; sudo apt-get install -y python3-pip; printf "\n\n"; } &>> ./log/install.txt + ;; + centos|fedora|redhat) + if command -v dnf &> /dev/null; then + { sudo dnf install -y python3-pip; printf "\n\n"; } >> ./log/install.txt + else + { sudo yum install -y python3-pip printf "\n\n"; } >> ./log/install.txt + fi + ;; + *) + 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" + exit 1 + ;; + esac fi if ! $pythonExecutable -m pip -h > /dev/null 2>&1