From 4efdf7606cec25609b64ef4a11532bf513ba0608 Mon Sep 17 00:00:00 2001 From: dami Date: Fri, 11 Sep 2026 22:48:34 +0800 Subject: [PATCH] update --- cli.sh | 4 ++-- scripts/getos.sh | 4 ++-- scripts/install.sh | 10 +++++----- scripts/install/alma.sh | 4 ++-- scripts/install/alpine.sh | 2 +- scripts/install/amazon.sh | 4 ++-- scripts/install/arch.sh | 4 ++-- scripts/install/centos.sh | 4 ++-- scripts/install/debian.sh | 10 +++++----- scripts/install/euler.sh | 4 ++-- scripts/install/fedora.sh | 4 ++-- scripts/install/freebsd.sh | 2 +- scripts/install/opensuse.sh | 2 +- scripts/install/rhel.sh | 6 +++--- scripts/install/rocky.sh | 2 +- scripts/install/ubuntu.sh | 10 +++++----- scripts/install_dev.sh | 10 +++++----- scripts/lib.sh | 26 +++++++++++++------------- scripts/old/install.sh | 10 +++++----- scripts/old/update.sh | 4 ++-- scripts/rememory.sh | 6 +++--- scripts/update.sh | 6 +++--- scripts/update_dev.sh | 6 +++--- 23 files changed, 72 insertions(+), 72 deletions(-) diff --git a/cli.sh b/cli.sh index a218a395b..ad18d8b97 100755 --- a/cli.sh +++ b/cli.sh @@ -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 diff --git a/scripts/getos.sh b/scripts/getos.sh index 2e15da244..829458505 100755 --- a/scripts/getos.sh +++ b/scripts/getos.sh @@ -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 \ No newline at end of file diff --git a/scripts/install.sh b/scripts/install.sh index 115b6fdee..7db9b34e8 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -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 diff --git a/scripts/install/alma.sh b/scripts/install/alma.sh index 9b3b757b0..0ed77cba6 100755 --- a/scripts/install/alma.sh +++ b/scripts/install/alma.sh @@ -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 diff --git a/scripts/install/alpine.sh b/scripts/install/alpine.sh index b69eff498..90e4a94db 100644 --- a/scripts/install/alpine.sh +++ b/scripts/install/alpine.sh @@ -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 diff --git a/scripts/install/amazon.sh b/scripts/install/amazon.sh index 38068871f..214b7ba4b 100755 --- a/scripts/install/amazon.sh +++ b/scripts/install/amazon.sh @@ -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 diff --git a/scripts/install/arch.sh b/scripts/install/arch.sh index 5131bfddf..9be5901cd 100644 --- a/scripts/install/arch.sh +++ b/scripts/install/arch.sh @@ -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 diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index c52f5c277..c74d6c84f 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -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 diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 7d26743aa..750256af8 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -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 diff --git a/scripts/install/euler.sh b/scripts/install/euler.sh index e40bd38c6..65e390d46 100755 --- a/scripts/install/euler.sh +++ b/scripts/install/euler.sh @@ -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 diff --git a/scripts/install/fedora.sh b/scripts/install/fedora.sh index be0996501..6f3ecec1d 100644 --- a/scripts/install/fedora.sh +++ b/scripts/install/fedora.sh @@ -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 diff --git a/scripts/install/freebsd.sh b/scripts/install/freebsd.sh index 8cc92d3d2..b101fe83e 100644 --- a/scripts/install/freebsd.sh +++ b/scripts/install/freebsd.sh @@ -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" diff --git a/scripts/install/opensuse.sh b/scripts/install/opensuse.sh index e1196cf8a..899006bdc 100644 --- a/scripts/install/opensuse.sh +++ b/scripts/install/opensuse.sh @@ -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 diff --git a/scripts/install/rhel.sh b/scripts/install/rhel.sh index 3c64e220f..94b631739 100644 --- a/scripts/install/rhel.sh +++ b/scripts/install/rhel.sh @@ -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 diff --git a/scripts/install/rocky.sh b/scripts/install/rocky.sh index f808bb5b3..776822bcc 100644 --- a/scripts/install/rocky.sh +++ b/scripts/install/rocky.sh @@ -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 diff --git a/scripts/install/ubuntu.sh b/scripts/install/ubuntu.sh index 1d121f07a..aaf1d5275 100644 --- a/scripts/install/ubuntu.sh +++ b/scripts/install/ubuntu.sh @@ -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 diff --git a/scripts/install_dev.sh b/scripts/install_dev.sh index 97e16a742..2e4fff61d 100755 --- a/scripts/install_dev.sh +++ b/scripts/install_dev.sh @@ -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 diff --git a/scripts/lib.sh b/scripts/lib.sh index ed3158bc3..aa0d49e0a 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -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 diff --git a/scripts/old/install.sh b/scripts/old/install.sh index 8971bfea2..61c4a5874 100644 --- a/scripts/old/install.sh +++ b/scripts/old/install.sh @@ -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 diff --git a/scripts/old/update.sh b/scripts/old/update.sh index fb9527f91..a2fe61571 100644 --- a/scripts/old/update.sh +++ b/scripts/old/update.sh @@ -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 diff --git a/scripts/rememory.sh b/scripts/rememory.sh index 5311e7aa6..409fde7ae 100755 --- a/scripts/rememory.sh +++ b/scripts/rememory.sh @@ -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 diff --git a/scripts/update.sh b/scripts/update.sh index 265afc47b..c2cbbf33f 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -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' diff --git a/scripts/update_dev.sh b/scripts/update_dev.sh index 7fc281e8f..9a76c1cd4 100755 --- a/scripts/update_dev.sh +++ b/scripts/update_dev.sh @@ -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'