From 0fb6eb3626225e128715a8bc9949bacb9c8d9efe Mon Sep 17 00:00:00 2001 From: r0fus0d Date: Wed, 22 Nov 2023 20:11:49 +0800 Subject: [PATCH] fix python bug --- f8x | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/f8x b/f8x index dc6e6f91..ba8c6681 100644 --- a/f8x +++ b/f8x @@ -541,6 +541,10 @@ pip2_Check(){ which pip2 > /dev/null 2>&1 ;; esac + ;; + *) + which pip2 > /dev/null 2>&1 + ;; esac if [ $? == 0 ] @@ -778,6 +782,10 @@ Install_Switch4(){ pip3 install $1 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "Successfully installed $1 (python3)" && return 0 || { Echo_ERROR "$1 module installation failed"; return 1; } ;; esac + ;; + *) + pip3 install $1 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "Successfully installed $1 (python3)" && return 0 || { Echo_ERROR "$1 module installation failed"; return 1; } + ;; esac } @@ -795,6 +803,10 @@ Install_Switch5(){ python3 -m pip install $1 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "Successfully installed $1 (python3)" && return 0 || { Echo_ERROR "$1 module installation failed"; return 1; } ;; esac + ;; + *) + python3 -m pip install $1 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "Successfully installed $1 (python3)" && return 0 || { Echo_ERROR "$1 module installation failed"; return 1; } + ;; esac } @@ -811,6 +823,10 @@ Install_Switch6(){ python3 -m pip install -r $1 > /dev/null 2>&1 ;; esac + ;; + *) + python3 -m pip install -r $1 > /dev/null 2>&1 + ;; esac } @@ -827,6 +843,10 @@ Install_Switch7(){ pip3 install -r $1 > /dev/null 2>&1 ;; esac + ;; + *) + pip3 install -r $1 > /dev/null 2>&1 + ;; esac } @@ -6971,7 +6991,6 @@ pip2_Install(){ echo -e "\033[1;33m\n>> Installing pip2\n\033[0m" - case $Linux_Version in *"Debian"*) case $Linux_Version_Num in @@ -6985,6 +7004,12 @@ pip2_Install(){ rm -f get-pip.py > /dev/null 2>&1 ;; esac + ;; + *) + cd $T_Dir && $Proxy_OK curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py > /dev/null 2>&1 || Echo_ERROR "https://bootstrap.pypa.io/get-pip.py download failed, please check if the network is reachable, proxychains4 configuration is correct" + $Proxy_OK python2 get-pip.py > /dev/null 2>&1 && Echo_INFOR "Successfully installed python-pip" || Echo_ERROR "python-pip installation failed" + rm -f get-pip.py > /dev/null 2>&1 + ;; esac Install_Switch3 "setuptools"