pull/382/head
midoks 2 years ago
parent e5ab03951f
commit f161f24253
  1. 2
      scripts/install.sh
  2. 21
      scripts/install_dev.sh

@ -72,7 +72,7 @@ if [ $OSNAME != "macos" ];then
# https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh # https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") cn=$(curl --insecure -fsSL -m 10 https://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ ! -d /www/server/mdserver-web ];then if [ ! -d /www/server/mdserver-web ];then
if [ ! -z "$cn" ];then if [ ! -z "$cn" ];then

@ -60,6 +60,13 @@ else
fi fi
HTTP_PREFIX="https://"
ping github.com -t 1
if [ "$?" != "0" ];then
HTTP_PREFIX="https://ghproxy.com/"
fi
if [ $OSNAME != "macos" ];then if [ $OSNAME != "macos" ];then
mkdir -p /www/server mkdir -p /www/server
mkdir -p /www/wwwroot mkdir -p /www/wwwroot
@ -68,7 +75,7 @@ if [ $OSNAME != "macos" ];then
mkdir -p /www/backup/site mkdir -p /www/backup/site
if [ ! -d /www/server/mdserver-web ];then if [ ! -d /www/server/mdserver-web ];then
curl -sSLo /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip curl -sSLo /tmp/dev.zip ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/heads/dev.zip
cd /tmp && unzip /tmp/dev.zip cd /tmp && unzip /tmp/dev.zip
mv -f /tmp/mdserver-web-dev /www/server/mdserver-web mv -f /tmp/mdserver-web-dev /www/server/mdserver-web
rm -rf /tmp/dev.zip rm -rf /tmp/dev.zip
@ -94,12 +101,12 @@ fi
echo "use system version: ${OSNAME}" echo "use system version: ${OSNAME}"
if [ "${OSNAME}" == "macos" ];then if [ "${OSNAME}" == "macos" ];then
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") # cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
HTTP_PREFIX="https://" # HTTP_PREFIX="https://"
if [ ! -z "$cn" ];then # if [ ! -z "$cn" ];then
HTTP_PREFIX="https://ghproxy.com/" # HTTP_PREFIX="https://ghproxy.com/"
fi # fi
curl -fsSL ${HTTP_PREFIX}https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install/macos.sh | bash curl -fsSL ${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install/macos.sh | bash
else else
cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh
fi fi

Loading…
Cancel
Save