This commit is contained in:
2026-09-11 22:48:34 +08:00
parent a61644861b
commit 4efdf7606c
23 changed files with 72 additions and 72 deletions

4
cli.sh
View File

@@ -19,12 +19,12 @@ fi
mw_start_task()
{
isStart=$(ps aux |grep 'panel_task.py'|grep -v grep|awk '{print $2}')
if [ "$isStart" == '' ];then
if [ "$isStart" = '' ];then
echo -e "starting mw-tasks... \c"
cd $DIR && python3 panel_task.py >> ${DIR}/logs/panel_task.log 2>&1 &
sleep 0.3
isStart=$(ps aux |grep 'panel_task.py'|grep -v grep|awk '{print $2}')
if [ "$isStart" == '' ];then
if [ "$isStart" = '' ];then
echo -e "\033[31mfailed\033[0m"
echo '------------------------------------------------------'
tail -n 20 $DIR/logs/panel_task.log

View File

@@ -4,7 +4,7 @@ export PATH
#获取信息和版本
_os=`uname`
if [ ${_os} == "Darwin" ]; then
if [ ${_os} = "Darwin" ]; then
OSNAME='macos'
elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse'
@@ -44,6 +44,6 @@ if [ -d /www/server/mdserver-web ];then
echo "$OSNAME" > /www/server/mdserver-web/data/osname.pl
fi
if [ "$OSNAME" == "macos" ];then
if [ "$OSNAME" = "macos" ];then
echo "$OSNAME"
fi

View File

@@ -31,7 +31,7 @@ LOG_FILE=/var/log/mw-install.log
HTTP_PREFIX="https://"
LOCAL_ADDR=common
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
if [ ! -z "$cn" ] || [ "$?" = "0" ] ;then
LOCAL_ADDR=cn
fi
@@ -106,7 +106,7 @@ function ChooseProxyURL(){
read -p "${CHOICE_A}" INPUT
# echo $INPUT
if [ "$INPUT" == "" ];then
if [ "$INPUT" = "" ];then
INPUT=1
TMP_INPUT=`expr $INPUT - 1`
INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]}
@@ -157,7 +157,7 @@ startTime=`date +%s`
_os=`uname`
echo "use system: ${_os}"
if [ ${_os} == "Darwin" ]; then
if [ ${_os} = "Darwin" ]; then
OSNAME='macos'
elif grep -Eqi "openSUSE" /etc/*-release; then
OSNAME='opensuse'
@@ -248,13 +248,13 @@ if [ $OSNAME != "macos" ];then
fi
echo "use system version: ${OSNAME}"
if [ "${OSNAME}" == "macos" ];then
if [ "${OSNAME}" = "macos" ];then
curl --insecure -fsSL ${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/refs/heads/dev/scripts/install/macos.sh | bash
else
cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh
fi
if [ "${OSNAME}" == "macos" ];then
if [ "${OSNAME}" = "macos" ];then
echo "macos end"
exit 0
fi

View File

@@ -26,7 +26,7 @@ yum install -y brotli-devel
yum install -y vim-common
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then
if [ "$SSH_PORT" = "" ];then
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
fi
@@ -41,7 +41,7 @@ echo "SSH PORT:${SSH_PORT}"
# service iptables save
# iptables_status=`service iptables status | grep 'not running'`
# if [ "${iptables_status}" == '' ];then
# if [ "${iptables_status}" = '' ];then
# service iptables restart
# fi

View File

@@ -61,7 +61,7 @@ apk add zstd-dev --force-broken-world
# apk add php-config
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then
if [ "$SSH_PORT" = "" ];then
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
fi

View File

@@ -33,7 +33,7 @@ yum install -y brotli-devel
yum install -y vim-common
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then
if [ "$SSH_PORT" = "" ];then
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
fi
@@ -48,7 +48,7 @@ echo "SSH PORT:${SSH_PORT}"
# service iptables save
# iptables_status=`service iptables status | grep 'not running'`
# if [ "${iptables_status}" == '' ];then
# if [ "${iptables_status}" = '' ];then
# service iptables restart
# fi

View File

@@ -62,7 +62,7 @@ echo y | pacman -Syu icu
hwclock --systohc
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then
if [ "$SSH_PORT" = "" ];then
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
fi
@@ -77,7 +77,7 @@ echo "SSH PORT:${SSH_PORT}"
# service iptables save
# iptables_status=`service iptables status | grep 'not running'`
# if [ "${iptables_status}" == '' ];then
# if [ "${iptables_status}" = '' ];then
# service iptables restart
# fi

View File

@@ -14,7 +14,7 @@ setenforce 0
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then
if [ "$SSH_PORT" = "" ];then
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
fi
@@ -52,7 +52,7 @@ yum install -y vim-common
# service iptables save
# iptables_status=`service iptables status | grep 'not running'`
# if [ "${iptables_status}" == '' ];then
# if [ "${iptables_status}" = '' ];then
# service iptables restart
# fi

View File

@@ -5,9 +5,9 @@ export LANG=en_US.UTF-8
export DEBIAN_FRONTEND=noninteractive
function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; }
function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" = "$1"; }
function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" = "$1"; }
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
@@ -16,13 +16,13 @@ cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
ln -sf /bin/bash /bin/sh
__GET_BIT=`getconf LONG_BIT`
if [ "$__GET_BIT" == "32" ];then
if [ "$__GET_BIT" = "32" ];then
# install rust | 32bit need
# curl https://sh.rustup.rs -sSf | sh
apt install -y rustc
fi
if [ "$VERSION_ID" == "10" ];then
if [ "$VERSION_ID" = "10" ];then
apt install -y rustc
fi
@@ -42,7 +42,7 @@ apt install ntpdate -y
apt install -y net-tools
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then
if [ "$SSH_PORT" = "" ];then
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
fi

View File

@@ -14,7 +14,7 @@ setenforce 0
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then
if [ "$SSH_PORT" = "" ];then
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
fi
@@ -53,7 +53,7 @@ yum install -y vim-common
# service iptables save
# iptables_status=`service iptables status | grep 'not running'`
# if [ "${iptables_status}" == '' ];then
# if [ "${iptables_status}" = '' ];then
# service iptables restart
# fi

View File

@@ -25,7 +25,7 @@ yum install -y vim-common
dnf install crontabs -y
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then
if [ "$SSH_PORT" = "" ];then
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
fi
@@ -43,7 +43,7 @@ echo "SSH PORT:${SSH_PORT}"
# service iptables save
# iptables_status=`service iptables status | grep 'not running'`
# if [ "${iptables_status}" == '' ];then
# if [ "${iptables_status}" = '' ];then
# service iptables restart
# fi

View File

@@ -81,7 +81,7 @@ echo "SSH PORT:${SSH_PORT}"
# 检测防火墙是否开启
FW_ENABLE=`cat /etc/rc.conf | grep firewall_enable`
if [ "$FW_ENABLE" == "" ];then
if [ "$FW_ENABLE" = "" ];then
sysrc firewall_enable="YES"
sysrc firewall_type="open"
sysrc firewall_script="/etc/ipfw.rules"

View File

@@ -66,7 +66,7 @@ zypper install -y brotli-devel
# zypper install -y php-config
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then
if [ "$SSH_PORT" = "" ];then
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
fi

View File

@@ -50,7 +50,7 @@ $PKGMGR install -y brotli-devel
$PKGMGR install -y vim-common
echo "install remi source"
if [ "$VERSION_ID" == "9" ];then
if [ "$VERSION_ID" = "9" ];then
# dnf upgrade --refresh -y
dnf config-manager --set-enabled crb
@@ -70,7 +70,7 @@ fi
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then
if [ "$SSH_PORT" = "" ];then
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
fi
@@ -182,7 +182,7 @@ if [ "$VERSION_ID" -ge "8" ];then
fi
done
if [ "$REPOS" == "--enablerepo=" ];then
if [ "$REPOS" = "--enablerepo=" ];then
# if not find, reset emtpy
REPOS=''
fi

View File

@@ -45,7 +45,7 @@ if [ -f /usr/sbin/iptables ];then
service iptables save
iptables_status=`service iptables status | grep 'not running'`
if [ "${iptables_status}" == '' ];then
if [ "${iptables_status}" = '' ];then
service iptables restart
fi

View File

@@ -5,9 +5,9 @@ export LANG=en_US.UTF-8
export DEBIAN_FRONTEND=noninteractive
function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; }
function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" = "$1"; }
function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" = "$1"; }
if grep -Eq "Ubuntu" /etc/*-release; then
@@ -86,7 +86,7 @@ else
fi
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then
if [ "$SSH_PORT" = "" ];then
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`
SSH_PORT=${SSH_PORT_LINE/"Port "/""}
fi
@@ -223,7 +223,7 @@ apt install -y libmariadb-dev-compat
apt install -y patchelf
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
if [ "${VERSION_ID}" == "22.04" ];then
if [ "${VERSION_ID}" = "22.04" ];then
apt install -y python3-cffi
pip3 install -U --force-reinstall --no-binary :all: gevent
fi
@@ -239,7 +239,7 @@ cd /www/server/mdserver-web/scripts && bash lib.sh
chmod 755 /www/server/mdserver-web/data
if [ "${VERSION_ID}" == "22.04" ];then
if [ "${VERSION_ID}" = "22.04" ];then
apt install -y python3-cffi
pip3 install -U --force-reinstall --no-binary :all: gevent
fi

View File

@@ -36,7 +36,7 @@ LOG_FILE=/var/log/mw-install.log
HTTP_PREFIX="https://"
LOCAL_ADDR=common
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
if [ ! -z "$cn" ] || [ "$?" = "0" ] ;then
LOCAL_ADDR=cn
fi
@@ -110,7 +110,7 @@ function ChooseProxyURL(){
read -p "${CHOICE_A}" INPUT
# echo $INPUT
if [ "$INPUT" == "" ];then
if [ "$INPUT" = "" ];then
INPUT=1
TMP_INPUT=`expr $INPUT - 1`
INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]}
@@ -162,7 +162,7 @@ _os=`uname`
echo "use system: ${_os}"
if [ ${_os} == "Darwin" ]; then
if [ ${_os} = "Darwin" ]; then
OSNAME='macos'
elif grep -Eq "openSUSE" /etc/*-release; then
OSNAME='opensuse'
@@ -257,13 +257,13 @@ fi
echo "use system version: ${OSNAME}"
if [ "${OSNAME}" == "macos" ];then
if [ "${OSNAME}" = "macos" ];then
curl --insecure -fsSL ${HTTP_PREFIX}raw.githubusercontent.com/midoks/mdserver-web/refs/heads/dev/scripts/install/macos.sh | bash
else
cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh
fi
if [ "${OSNAME}" == "macos" ];then
if [ "${OSNAME}" = "macos" ];then
echo "macos end"
exit 0
fi

View File

@@ -2,9 +2,9 @@
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" == "$1"; }
function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" = "$1"; }
function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" = "$1"; }
P_VER=`python3 -V | awk '{print $2}'`
echo "python:$P_VER"
@@ -26,30 +26,30 @@ OSNAME=`cat ${rootPath}/data/osname.pl`
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
# system judge
if [ "$OSNAME" == "macos" ]; then
if [ "$OSNAME" = "macos" ]; then
brew install libmemcached
brew install curl
brew install zlib
brew install freetype
brew install openssl
brew install libzip
elif [ "$OSNAME" == "opensuse" ];then
elif [ "$OSNAME" = "opensuse" ];then
echo "opensuse lib"
elif [ "$OSNAME" == "arch" ];then
elif [ "$OSNAME" = "arch" ];then
echo "arch lib"
elif [ "$OSNAME" == "freebsd" ];then
elif [ "$OSNAME" = "freebsd" ];then
echo "freebsd lib"
elif [ "$OSNAME" == "centos" ];then
elif [ "$OSNAME" = "centos" ];then
echo "centos lib"
elif [ "$OSNAME" == "rocky" ]; then
elif [ "$OSNAME" = "rocky" ]; then
echo "rocky lib"
elif [ "$OSNAME" == "fedora" ];then
elif [ "$OSNAME" = "fedora" ];then
echo "fedora lib"
elif [ "$OSNAME" == "alma" ];then
elif [ "$OSNAME" = "alma" ];then
echo "alma lib"
elif [ "$OSNAME" == "ubuntu" ];then
elif [ "$OSNAME" = "ubuntu" ];then
echo "ubuntu lib"
elif [ "$OSNAME" == "debian" ]; then
elif [ "$OSNAME" = "debian" ]; then
echo "debian lib"
else
echo "OK"
@@ -60,7 +60,7 @@ echo "system:${OSNAME}:${VERSION_ID}"
HTTP_PREFIX="https://"
LOCAL_ADDR=common
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
if [ ! -z "$cn" ] || [ "$?" = "0" ] ;then
LOCAL_ADDR=cn
fi

View File

@@ -19,7 +19,7 @@ startTime=`date +%s`
_os=`uname`
echo "use system: ${_os}"
if [ ${_os} == "Darwin" ]; then
if [ ${_os} = "Darwin" ]; then
OSNAME='macos'
elif grep -Eqi "openSUSE" /etc/*-release; then
OSNAME='opensuse'
@@ -75,7 +75,7 @@ fi
HTTP_PREFIX="https://"
LOCAL_ADDR=common
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
if [ ! -z "$cn" ] || [ "$?" = "0" ] ;then
LOCAL_ADDR=cn
HTTP_PREFIX="https://mirror.ghproxy.com/"
fi
@@ -98,7 +98,7 @@ if [ $OSNAME != "macos" ];then
# https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/install.sh
if [ ! -d /www/server/mdserver-web ];then
if [ "$LOCAL_ADDR" == "common" ];then
if [ "$LOCAL_ADDR" = "common" ];then
curl --insecure -sSLo /tmp/master.zip ${HTTP_PREFIX}github.com/midoks/mdserver-web/archive/refs/tags/${VERSION}.zip
cd /tmp && unzip /tmp/master.zip
mv -f /tmp/mdserver-web-${VERSION} /www/server/mdserver-web
@@ -132,13 +132,13 @@ if [ $OSNAME != "macos" ];then
fi
echo "use system version: ${OSNAME}"
if [ "${OSNAME}" == "macos" ];then
if [ "${OSNAME}" = "macos" ];then
curl --insecure -fsSL https://code.midoks.icu/midoks/mdserver-web/raw/branch/master/scripts/install/macos.sh | bash
else
cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh
fi
if [ "${OSNAME}" == "macos" ];then
if [ "${OSNAME}" = "macos" ];then
echo "macos end"
exit 0
fi

View File

@@ -24,7 +24,7 @@ LOG_FILE=/var/log/mw-update.log
{
if [ ${_os} == "Darwin" ]; then
if [ ${_os} = "Darwin" ]; then
OSNAME='macos'
elif grep -Eqi "openSUSE" /etc/*-release; then
OSNAME='opensuse'
@@ -64,7 +64,7 @@ fi
HTTP_PREFIX="https://"
LOCAL_ADDR=common
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
if [ ! -z "$cn" ] || [ "$?" = "0" ] ;then
LOCAL_ADDR=cn
HTTP_PREFIX="https://mirror.ghproxy.com/"
fi

View File

@@ -14,7 +14,7 @@ log="释放内存!"
echo "★[$endDate] $log"
echo '----------------------------------------------------------------------------'
if [ $sysName == 'Darwin' ]; then
if [ $sysName = 'Darwin' ]; then
echo '苹果内存释放!'
else
echo 'do start!'
@@ -32,7 +32,7 @@ fi
echo "OpenResty -- END"
PHP_VER_LIST=(53 54 55 56 70 71 72 73 74 80 81 82 83 84)
PHP_VER_LIST=(53 54 55 56 70 71 72 73 74 80 81 82 83 84 85)
for PHP_VER in ${PHP_VER_LIST[@]}; do
echo "PHP${PHP_VER} -- START"
if [ -f /usr/lib/systemd/system/php${PHP_VER}.service ];then
@@ -72,7 +72,7 @@ sync
sleep 2
sync
if [ $sysName == 'Darwin' ]; then
if [ $sysName = 'Darwin' ]; then
echo 'done!'
else
echo 3 > /proc/sys/vm/drop_caches

View File

@@ -32,7 +32,7 @@ LOG_FILE=/var/log/mw-update.log
HTTP_PREFIX="https://"
LOCAL_ADDR=common
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
if [ ! -z "$cn" ] || [ "$?" = "0" ] ;then
LOCAL_ADDR=cn
fi
@@ -106,7 +106,7 @@ function ChooseProxyURL(){
read -p "${CHOICE_A}" INPUT
# echo $INPUT
if [ "$INPUT" == "" ];then
if [ "$INPUT" = "" ];then
INPUT=1
TMP_INPUT=`expr $INPUT - 1`
INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]}
@@ -149,7 +149,7 @@ if [ "$LOCAL_ADDR" != "common" ];then
fi
fi
if [ ${_os} == "Darwin" ]; then
if [ ${_os} = "Darwin" ]; then
OSNAME='macos'
elif grep -Eqi "openSUSE" /etc/*-release; then
OSNAME='opensuse'

View File

@@ -45,7 +45,7 @@ LOG_FILE=/var/log/mw-update.log
HTTP_PREFIX="https://"
LOCAL_ADDR=common
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
if [ ! -z "$cn" ] || [ "$?" = "0" ] ;then
LOCAL_ADDR=cn
fi
@@ -119,7 +119,7 @@ function ChooseProxyURL(){
read -p "${CHOICE_A}" INPUT
# echo $INPUT
if [ "$INPUT" == "" ];then
if [ "$INPUT" = "" ];then
INPUT=1
TMP_INPUT=`expr $INPUT - 1`
INPUT_KEY=${SOURCE_LIST_KEY[$TMP_INPUT]}
@@ -162,7 +162,7 @@ if [ "$LOCAL_ADDR" != "common" ];then
fi
fi
if [ ${_os} == "Darwin" ]; then
if [ ${_os} = "Darwin" ]; then
OSNAME='macos'
elif grep -Eqi "openSUSE" /etc/*-release; then
OSNAME='opensuse'