From 85258dd80bb51ee59784208bb96a2f79a686c1ab Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 3 Dec 2022 02:34:36 +0800 Subject: [PATCH] Update lib.sh --- scripts/lib.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/lib.sh b/scripts/lib.sh index 42ad9b8af..9cc0d512f 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -47,11 +47,14 @@ else echo "OK" fi - #面板需要的库 if [ ! -f /usr/local/bin/pip3 ];then - # python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple - python3 -m pip install --upgrade pip setuptools wheel -i https://pypi.python.org/pypi + cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") + if [ ! -z "$cn" ];then + python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple + else + python3 -m pip install --upgrade pip setuptools wheel -i https://pypi.python.org/pypi + fi fi which pip && pip install --upgrade pip