Update lib.sh

pull/397/head
midoks 2 years ago
parent 59d13e50ce
commit 6f1e11e474
  1. 10
      scripts/lib.sh

@ -47,14 +47,17 @@ else
echo "OK" echo "OK"
fi fi
# cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
HTTP_PREFIX="https://" HTTP_PREFIX="https://"
LOCAL_ADDR=common LOCAL_ADDR=common
ping -c 1 pypi.python.org > /dev/null 2>&1 ping -c 1 ipinfo.io > /dev/null 2>&1
if [ "$?" != "0" ];then if [ "$?" == "0" ];then
CN=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ -z $CN ];then
LOCAL_ADDR=cn LOCAL_ADDR=cn
HTTP_PREFIX="https://ghproxy.com/" HTTP_PREFIX="https://ghproxy.com/"
fi fi
fi
PIPSRC="https://pypi.python.org/simple" PIPSRC="https://pypi.python.org/simple"
if [ "$LOCAL_ADDR" != "common" ];then if [ "$LOCAL_ADDR" != "common" ];then
@ -69,6 +72,7 @@ fi
which pip && pip install --upgrade pip -i $PIPSRC which pip && pip install --upgrade pip -i $PIPSRC
pip3 install --upgrade pip setuptools wheel -i $PIPSRC pip3 install --upgrade pip setuptools wheel -i $PIPSRC
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -i $PIPSRC cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -i $PIPSRC
# pip3 install flask-caching==1.10.1 # pip3 install flask-caching==1.10.1

Loading…
Cancel
Save