This commit is contained in:
dami
2026-09-11 20:42:39 +08:00
parent ea45316a32
commit 44600b5657
49 changed files with 112 additions and 132 deletions
+4 -4
View File
@@ -38,7 +38,7 @@ else
useradd -g www -s /bin/bash www useradd -g www -s /bin/bash www
fi fi
if [ "${action}" == "upgrade" ];then if [ "${action}" = "upgrade" ];then
sh -x $curPath/versions/$2/install.sh $1 sh -x $curPath/versions/$2/install.sh $1
echo "${VERSION}" > $serverPath/apache/version.pl echo "${VERSION}" > $serverPath/apache/version.pl
@@ -53,12 +53,12 @@ if [ "${action}" == "upgrade" ];then
fi fi
if [ "${2}" == "" ];then if [ "${2}" = "" ];then
echo '缺少安装脚本版本...' echo '缺少安装脚本版本...'
exit 0 exit 0
fi fi
if [ "${action}" == "uninstall" ];then if [ "${action}" = "uninstall" ];then
if [ -f /usr/lib/systemd/system/httpd.service ] || [ -f /lib/systemd/system/httpd.service ];then if [ -f /usr/lib/systemd/system/httpd.service ] || [ -f /lib/systemd/system/httpd.service ];then
systemctl stop httpd systemctl stop httpd
rm -rf /usr/systemd/system/httpd.service rm -rf /usr/systemd/system/httpd.service
@@ -75,7 +75,7 @@ fi
sh -x $curPath/versions/$2/install.sh $1 sh -x $curPath/versions/$2/install.sh $1
if [ "${action}" == "install" ] && [ -d $serverPath/apache ];then if [ "${action}" = "install" ] && [ -d $serverPath/apache ];then
echo "${VERSION}" > $serverPath/apache/version.pl echo "${VERSION}" > $serverPath/apache/version.pl
mkdir -p $serverPath/web_conf/php/conf mkdir -p $serverPath/web_conf/php/conf
+4 -4
View File
@@ -19,7 +19,7 @@ apacheDir=${serverPath}/source/apache
Install_App() Install_App()
{ {
if [ "${action}" == "install" ];then if [ "${action}" = "install" ];then
if [ -d $serverPath/apache ];then if [ -d $serverPath/apache ];then
exit 0 exit 0
fi fi
@@ -71,7 +71,7 @@ Install_App()
cd ${apacheDir} && tar -jxf apr-${APR_VERSION}.tar.bz2 cd ${apacheDir} && tar -jxf apr-${APR_VERSION}.tar.bz2
cd ${apacheDir}/apr-${APR_VERSION} && ./configure --prefix=${serverPath}/apache/apr cd ${apacheDir}/apr-${APR_VERSION} && ./configure --prefix=${serverPath}/apache/apr
make -j${cpuCore} && make install make -j${cpuCore} && make install
if [ "$?" == "0" ];then if [ "$?" = "0" ];then
# 检查 APR 配置文件 # 检查 APR 配置文件
APR_CONFIG=$(find ${serverPath}/apache/apr -name "apr-*config" | head -1) APR_CONFIG=$(find ${serverPath}/apache/apr -name "apr-*config" | head -1)
if [ -z "$APR_CONFIG" ];then if [ -z "$APR_CONFIG" ];then
@@ -163,9 +163,9 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == "install" ];then if [ "${1}" = "install" ];then
Install_App Install_App
elif [ "${1}" == "upgrade" ];then elif [ "${1}" = "upgrade" ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -24,7 +24,7 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App $2 Install_App $2
else else
Uninstall_App $2 Uninstall_App $2
+1 -1
View File
@@ -27,7 +27,7 @@ else
fi fi
NGINX_IDS=`ps -ef|grep caddy | grep -v grep| awk '{print $2}'` NGINX_IDS=`ps -ef|grep caddy | grep -v grep| awk '{print $2}'`
if [ "$NGINX_IDS" == "" ];then if [ "$NGINX_IDS" = "" ];then
ps -ef|grep caddy| grep -v grep| awk '{print $2}' | xargs kill -9 ps -ef|grep caddy| grep -v grep| awk '{print $2}' | xargs kill -9
systemctl start "$service_name" systemctl start "$service_name"
echo "caddy未运行,正在启动服务..." echo "caddy未运行,正在启动服务..."
+4 -4
View File
@@ -33,7 +33,7 @@ else
useradd -g www -s /bin/bash www useradd -g www -s /bin/bash www
fi fi
if [ "${action}" == "upgrade" ];then if [ "${action}" = "upgrade" ];then
sh -x $curPath/versions/$2/install.sh $1 sh -x $curPath/versions/$2/install.sh $1
echo "${VERSION}" > $serverPath/caddy/version.pl echo "${VERSION}" > $serverPath/caddy/version.pl
@@ -45,12 +45,12 @@ if [ "${action}" == "upgrade" ];then
fi fi
if [ "${2}" == "" ];then if [ "${2}" = "" ];then
echo '缺少安装脚本版本...' echo '缺少安装脚本版本...'
exit 0 exit 0
fi fi
if [ "${action}" == "uninstall" ];then if [ "${action}" = "uninstall" ];then
if [ -f /usr/lib/systemd/system/caddy.service ] || [ -f /lib/systemd/system/caddy.service ];then if [ -f /usr/lib/systemd/system/caddy.service ] || [ -f /lib/systemd/system/caddy.service ];then
systemctl stop caddy systemctl stop caddy
rm -rf /usr/systemd/system/caddy.service rm -rf /usr/systemd/system/caddy.service
@@ -67,7 +67,7 @@ fi
sh -x $curPath/versions/$2/install.sh $1 sh -x $curPath/versions/$2/install.sh $1
if [ "${action}" == "install" ] && [ -d $serverPath/caddy ];then if [ "${action}" = "install" ] && [ -d $serverPath/caddy ];then
echo "${VERSION}" > $serverPath/caddy/version.pl echo "${VERSION}" > $serverPath/caddy/version.pl
#初始化 #初始化
+3 -3
View File
@@ -39,7 +39,7 @@ caddyDir=${serverPath}/source/caddy
Install_App() Install_App()
{ {
if [ "${action}" == "install" ];then if [ "${action}" = "install" ];then
if [ -d $serverPath/caddy ];then if [ -d $serverPath/caddy ];then
exit 0 exit 0
fi fi
@@ -79,9 +79,9 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == "install" ];then if [ "${1}" = "install" ];then
Install_App Install_App
elif [ "${1}" == "upgrade" ];then elif [ "${1}" = "upgrade" ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -35,7 +35,7 @@ Uninstall_app()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_app Install_app
else else
Uninstall_app Uninstall_app
+4 -4
View File
@@ -16,11 +16,11 @@ sysArch=`arch`
sysName=`uname` sysName=`uname`
ALIST_ARCH_NAME=amd64 ALIST_ARCH_NAME=amd64
if [ "$sysArch" == "arm64" ];then if [ "$sysArch" = "arm64" ];then
ALIST_ARCH_NAME=arm64 ALIST_ARCH_NAME=arm64
elif [ "$sysArch" == "x86_64" ]; then elif [ "$sysArch" = "x86_64" ]; then
ALIST_ARCH_NAME=amd64 ALIST_ARCH_NAME=amd64
elif [ "$sysArch" == "aarch64" ]; then elif [ "$sysArch" = "aarch64" ]; then
ALIST_ARCH_NAME=aarch64 ALIST_ARCH_NAME=aarch64
fi fi
@@ -83,7 +83,7 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -56,7 +56,7 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+2 -2
View File
@@ -69,7 +69,7 @@ Uninstall_Docker()
{ {
CMD=yum CMD=yum
which apt which apt
if [ "$?" == "0" ];then if [ "$?" = "0" ];then
CMD=apt CMD=apt
fi fi
@@ -97,7 +97,7 @@ Uninstall_Docker()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_Docker Install_Docker
else else
Uninstall_Docker Uninstall_Docker
+1 -1
View File
@@ -83,7 +83,7 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -67,7 +67,7 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -101,7 +101,7 @@ action=$1
type=$2 type=$2
echo $action $type echo $action $type
if [ "${action}" == 'install' ];then if [ "${action}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+3 -3
View File
@@ -22,7 +22,7 @@ else
useradd -g haproxy haproxy useradd -g haproxy haproxy
fi fi
if [ "${2}" == "" ];then if [ "${2}" = "" ];then
echo '缺少安装脚本...' echo '缺少安装脚本...'
exit 0 exit 0
fi fi
@@ -32,7 +32,7 @@ if [ ! -d $curPath/versions/$2 ];then
exit 0 exit 0
fi fi
if [ "${action}" == "uninstall" ];then if [ "${action}" = "uninstall" ];then
if [ -f /usr/lib/systemd/system/haproxy.service ] || [ -f /lib/systemd/system/haproxy.service ];then if [ -f /usr/lib/systemd/system/haproxy.service ] || [ -f /lib/systemd/system/haproxy.service ];then
systemctl stop haproxy systemctl stop haproxy
@@ -45,7 +45,7 @@ fi
sh -x $curPath/versions/$2/install.sh $1 sh -x $curPath/versions/$2/install.sh $1
if [ "${action}" == "install" ] && [ -d $serverPath/haproxy ];then if [ "${action}" = "install" ] && [ -d $serverPath/haproxy ];then
#初始化 #初始化
cd ${rootPath} && python3 ${rootPath}/plugins/haproxy/index.py start ${type} cd ${rootPath} && python3 ${rootPath}/plugins/haproxy/index.py start ${type}
cd ${rootPath} && python3 ${rootPath}/plugins/haproxy/index.py initd_install ${type} cd ${rootPath} && python3 ${rootPath}/plugins/haproxy/index.py initd_install ${type}
+1 -1
View File
@@ -10,7 +10,7 @@ serverPath=$(dirname "$rootPath")
action=$1 action=$1
type=$2 type=$2
if [ "${2}" == "" ];then if [ "${2}" = "" ];then
echo '缺少安装脚本...' echo '缺少安装脚本...'
exit 0 exit 0
fi fi
+15 -15
View File
@@ -23,9 +23,9 @@ SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | a
Install_app_mac() Install_app_mac()
{ {
mkdir -p $serverPath/mongodb mkdir -p $serverPath/mongodb
if [ "$VERSION" == "5.0" ];then if [ "$VERSION" = "5.0" ];then
G_VERSION="5.0.11" G_VERSION="5.0.11"
elif [[ "$VERSION" == "4.4" ]]; then elif [[ "$VERSION" = "4.4" ]]; then
G_VERSION="4.4.11" G_VERSION="4.4.11"
fi fi
@@ -52,11 +52,11 @@ fi
echo $SYS_VERSION_ID echo $SYS_VERSION_ID
SOURCE_NAME=bionic SOURCE_NAME=bionic
if [ "$SYS_VERSION_ID" == "18.04" ];then if [ "$SYS_VERSION_ID" = "18.04" ];then
SOURCE_NAME=bionic SOURCE_NAME=bionic
elif [ "$SYS_VERSION_ID" == "16.04" ];then elif [ "$SYS_VERSION_ID" = "16.04" ];then
SOURCE_NAME=xenial SOURCE_NAME=xenial
elif [ "$SYS_VERSION_ID" == "20.04" ];then elif [ "$SYS_VERSION_ID" = "20.04" ];then
SOURCE_NAME=focal SOURCE_NAME=focal
fi fi
@@ -210,13 +210,13 @@ rm -rf /etc/yum.repos.d/mongodb-org-${VERSION}.repo
Install_app_linux() Install_app_linux()
{ {
if [ "$OSNAME" == "ubuntu" ];then if [ "$OSNAME" = "ubuntu" ];then
Install_Linux_Ubuntu Install_Linux_Ubuntu
elif [ "$OSNAME" == "debian" ];then elif [ "$OSNAME" = "debian" ];then
Install_Linux_Debian Install_Linux_Debian
elif [ "$OSNAME" == "centos" ];then elif [ "$OSNAME" = "centos" ];then
Install_Linux_CentOS Install_Linux_CentOS
elif [ "$OSNAME" == "opensuse" ];then elif [ "$OSNAME" = "opensuse" ];then
Install_Linux_Opensuse Install_Linux_Opensuse
else else
echo "Not yet supported" echo "Not yet supported"
@@ -252,13 +252,13 @@ Install_app()
Uninstall_app_linux() Uninstall_app_linux()
{ {
################## ##################
if [ "$OSNAME" == "ubuntu" ];then if [ "$OSNAME" = "ubuntu" ];then
Uninstall_Linux_Ubuntu Uninstall_Linux_Ubuntu
elif [ "$OSNAME" == "debian" ];then elif [ "$OSNAME" = "debian" ];then
Uninstall_Linux_Debian Uninstall_Linux_Debian
elif [ "$OSNAME" == "centos" ];then elif [ "$OSNAME" = "centos" ];then
Uninstall_Linux_CentOS Uninstall_Linux_CentOS
elif [ "$OSNAME" == "opensuse" ];then elif [ "$OSNAME" = "opensuse" ];then
Uninstall_Linux_Opensuse Uninstall_Linux_Opensuse
else else
echo "ok" echo "ok"
@@ -268,7 +268,7 @@ fi
Uninstall_app() Uninstall_app()
{ {
if [ "macos" == "$OSNAME" ];then if [ "macos" = "$OSNAME" ];then
echo 'mac' echo 'mac'
else else
Uninstall_app_linux Uninstall_app_linux
@@ -279,7 +279,7 @@ Uninstall_app()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_app Install_app
else else
Uninstall_app Uninstall_app
+3 -23
View File
@@ -50,26 +50,6 @@ Install_app()
echo '正在安装脚本文件...' echo '正在安装脚本文件...'
mkdir -p $serverPath/source mkdir -p $serverPath/source
# if id mongodb &> /dev/null ;then
# echo "mongodb uid is `id -u mongodb`"
# echo "mongodb shell is `grep "^mongodb:" /etc/passwd |cut -d':' -f7 `"
# else
# groupadd mongodb
# useradd -g mongodb mongodb
# fi
# if [ "centos" == "$OSNAME" ];then
# OSNAME=rhel
# fi
# if [ "fedora" == "$OSNAME" ];then
# OSNAME=rhel
# fi
# if [ "rocky" == "$OSNAME" ];then
# OSNAME=rhel
# fi
cd ${rootPath}/plugins/php/lib && /bin/bash openssl_11.sh cd ${rootPath}/plugins/php/lib && /bin/bash openssl_11.sh
shell_file=${curPath}/versions/${VERSION}/${OSNAME}.sh shell_file=${curPath}/versions/${VERSION}/${OSNAME}.sh
@@ -86,7 +66,7 @@ Install_app()
exit 1 exit 1
fi fi
if [ "$?" == "0" ];then if [ "$?" = "0" ];then
mkdir -p $serverPath/mongodb mkdir -p $serverPath/mongodb
echo "${VERSION}" > $serverPath/mongodb/version.pl echo "${VERSION}" > $serverPath/mongodb/version.pl
echo 'mongodb安装完成' echo 'mongodb安装完成'
@@ -96,7 +76,7 @@ Install_app()
cd ${rootPath} && python3 ${rootPath}/plugins/mongodb/index.py initd_install cd ${rootPath} && python3 ${rootPath}/plugins/mongodb/index.py initd_install
fi fi
if [ "${VERSION}" == "3.0" ];then if [ "${VERSION}" = "3.0" ];then
# 降低版本 # 降低版本
pip install pymongo==3.12.0 pip install pymongo==3.12.0
else else
@@ -122,7 +102,7 @@ Uninstall_app()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_app Install_app
else else
Uninstall_app Uninstall_app
+7 -7
View File
@@ -84,17 +84,17 @@ Install_app()
mkdir -p ${serverPath}/source/mtproxy mkdir -p ${serverPath}/source/mtproxy
echo "${1}" > ${serverPath}/mtproxy/version.pl echo "${1}" > ${serverPath}/mtproxy/version.pl
if [ "$OSNAME" == "centos" ]; then if [ "$OSNAME" = "centos" ]; then
yum install -y golang golang-src yum install -y golang golang-src
elif [ "$OSNAME" == "amazon" ]; then elif [ "$OSNAME" = "amazon" ]; then
yum install -y golang golang-src yum install -y golang golang-src
elif [ "$OSNAME" == "rocky" ]; then elif [ "$OSNAME" = "rocky" ]; then
yum install -y golang golang-src yum install -y golang golang-src
elif [ "$OSNAME" == "rhel" ]; then elif [ "$OSNAME" = "rhel" ]; then
yum install -y golang golang-src yum install -y golang golang-src
elif [ "$OSNAME" == "opensuse" ]; then elif [ "$OSNAME" = "opensuse" ]; then
zypper install -y golang golang-src zypper install -y golang golang-src
elif [ "$sysName" == "macos" ]; then elif [ "$sysName" = "macos" ]; then
echo "macos" echo "macos"
else else
apt install -y golang golang-src apt install -y golang golang-src
@@ -145,7 +145,7 @@ Uninstall_app()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_app $2 Install_app $2
else else
Uninstall_app $2 Uninstall_app $2
+1 -1
View File
@@ -41,7 +41,7 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -89,7 +89,7 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+10 -10
View File
@@ -20,13 +20,13 @@ Install_varnish()
echo '正在安装脚本文件...' echo '正在安装脚本文件...'
mkdir -p $serverPath/source mkdir -p $serverPath/source
if [ "${OSNAME}" == "macos" ]; then if [ "${OSNAME}" = "macos" ]; then
brew install varnish brew install varnish
elif [ "${OSNAME}" == "centos" ] || [ "${OSNAME}" == "fedora" ] || [ "${OSNAME}" == "alma" ] || [ "${OSNAME}" == "rocky" ]; then elif [ "${OSNAME}" = "centos" ] || [ "${OSNAME}" = "fedora" ] || [ "${OSNAME}" = "alma" ] || [ "${OSNAME}" = "rocky" ]; then
yum install varnish -y yum install varnish -y
elif [ "${OSNAME}" == "debian" ] || [ "${OSNAME}" == "ubuntu" ]; then elif [ "${OSNAME}" = "debian" ] || [ "${OSNAME}" = "ubuntu" ]; then
apt install varnish -y apt install varnish -y
elif [[ "$OSNAME" == "arch" ]]; then elif [[ "$OSNAME" = "arch" ]]; then
echo y | pacman -Sy varnish echo y | pacman -Sy varnish
elif [ "${OSNAME}" == "opensuse" ];then elif [ "${OSNAME}" == "opensuse" ];then
zypper install -y varnish zypper install -y varnish
@@ -48,15 +48,15 @@ Uninstall_varnish()
cd ${rootPath} && python3 ${rootPath}/plugins/varnish/index.py stop cd ${rootPath} && python3 ${rootPath}/plugins/varnish/index.py stop
cd ${rootPath} && python3 ${rootPath}/plugins/varnish/index.py initd_uninstall cd ${rootPath} && python3 ${rootPath}/plugins/varnish/index.py initd_uninstall
if [ "${OSNAME}" == "macos" ]; then if [ "${OSNAME}" = "macos" ]; then
brew uninstall varnish brew uninstall varnish
elif [ "${OSNAME}" == "centos" ] || [ "${OSNAME}" == "fedora" ] || [ "${OSNAME}" == "alma" ] || [ "${OSNAME}" == "rocky" ]; then elif [ "${OSNAME}" = "centos" ] || [ "${OSNAME}" = "fedora" ] || [ "${OSNAME}" = "alma" ] || [ "${OSNAME}" = "rocky" ]; then
yum remove varnish -y yum remove varnish -y
elif [ "${OSNAME}" == "debian" ] || [ "${OSNAME}" == "ubuntu" ]; then elif [ "${OSNAME}" = "debian" ] || [ "${OSNAME}" = "ubuntu" ]; then
apt remove varnish -y apt remove varnish -y
elif [[ "$OSNAME" == "arch" ]]; then elif [[ "$OSNAME" = "arch" ]]; then
echo y | pacman -Rv varnish echo y | pacman -Rv varnish
elif [ "${OSNAME}" == "opensuse" ];then elif [ "${OSNAME}" = "opensuse" ];then
zypper remove -y varnish zypper remove -y varnish
else else
echo "I won't support it" echo "I won't support it"
@@ -66,7 +66,7 @@ Uninstall_varnish()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_varnish Install_varnish
else else
Uninstall_varnish Uninstall_varnish
+1 -1
View File
@@ -26,7 +26,7 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -26,7 +26,7 @@ Uninstall_webssh()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_webssh Install_webssh
else else
Uninstall_webssh Uninstall_webssh
+1 -1
View File
@@ -153,7 +153,7 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+2 -2
View File
@@ -29,7 +29,7 @@ if [ "$LOCAL_ADDR" != "common" ];then
fi fi
if [ "$sys_os" == "Darwin" ];then if [ "$sys_os" = "Darwin" ];then
BAK='_bak' BAK='_bak'
else else
BAK='' BAK=''
@@ -152,7 +152,7 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -40,7 +40,7 @@ Uninstall_xh()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_xh $2 Install_xh $2
else else
Uninstall_xh $2 Uninstall_xh $2
+1 -1
View File
@@ -44,7 +44,7 @@ Uninstall_app()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_app $2 Install_app $2
else else
Uninstall_app $2 Uninstall_app $2
+7 -7
View File
@@ -31,9 +31,9 @@ fi
arch=$(arch) arch=$(arch)
if [[ $arch == "x86_64" || $arch == "x64" || $arch == "s390x" || $arch == "amd64" ]]; then if [[ $arch = "x86_64" || $arch = "x64" || $arch = "s390x" || $arch = "amd64" ]]; then
arch="amd64" arch="amd64"
elif [[ $arch == "aarch64" || $arch == "arm64" ]]; then elif [[ $arch = "aarch64" || $arch = "arm64" ]]; then
arch="arm64" arch="arm64"
else else
arch="amd64" arch="amd64"
@@ -57,22 +57,22 @@ if [[ -z "$os_version" && -f /etc/lsb-release ]]; then
os_version=$(awk -F'[= ."]+' '/DISTRIB_RELEASE/{print $2}' /etc/lsb-release) os_version=$(awk -F'[= ."]+' '/DISTRIB_RELEASE/{print $2}' /etc/lsb-release)
fi fi
if [[ x"${release}" == x"centos" ]]; then if [[ x"${release}" = x"centos" ]]; then
if [[ ${os_version} -le 6 ]]; then if [[ ${os_version} -le 6 ]]; then
echo -e "${red}请使用 CentOS 7 或更高版本的系统!${plain}\n" && exit 1 echo -e "${red}请使用 CentOS 7 或更高版本的系统!${plain}\n" && exit 1
fi fi
elif [[ x"${release}" == x"ubuntu" ]]; then elif [[ x"${release}" = x"ubuntu" ]]; then
if [[ ${os_version} -lt 16 ]]; then if [[ ${os_version} -lt 16 ]]; then
echo -e "${red}请使用 Ubuntu 16 或更高版本的系统!${plain}\n" && exit 1 echo -e "${red}请使用 Ubuntu 16 或更高版本的系统!${plain}\n" && exit 1
fi fi
elif [[ x"${release}" == x"debian" ]]; then elif [[ x"${release}" = x"debian" ]]; then
if [[ ${os_version} -lt 8 ]]; then if [[ ${os_version} -lt 8 ]]; then
echo -e "${red}请使用 Debian 8 或更高版本的系统!${plain}\n" && exit 1 echo -e "${red}请使用 Debian 8 或更高版本的系统!${plain}\n" && exit 1
fi fi
fi fi
install_base() { install_base() {
if [[ x"${release}" == x"centos" ]]; then if [[ x"${release}" = x"centos" ]]; then
yum install wget curl tar jq -y yum install wget curl tar jq -y
else else
apt install wget curl tar jq -y apt install wget curl tar jq -y
@@ -104,7 +104,7 @@ install_x-ui() {
systemctl stop x-ui systemctl stop x-ui
cd /usr/local/ cd /usr/local/
if [ $# == 0 ]; then if [ $# = 0 ]; then
last_version=$(curl -Lsk "https://api.github.com/repos/FranzKafkaYu/x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') last_version=$(curl -Lsk "https://api.github.com/repos/FranzKafkaYu/x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
if [[ ! -n "$last_version" ]]; then if [[ ! -n "$last_version" ]]; then
echo -e "${red}检测 x-ui 版本失败,可能是超出 Github API 限制,请稍后再试,或手动指定 x-ui 版本安装${plain}" echo -e "${red}检测 x-ui 版本失败,可能是超出 Github API 限制,请稍后再试,或手动指定 x-ui 版本安装${plain}"
+3 -3
View File
@@ -21,11 +21,11 @@ echo "use system: ${sysName}"
OSNAME=`bash ${rootPath}/scripts/getos.sh` OSNAME=`bash ${rootPath}/scripts/getos.sh`
if [ "" == "$OSNAME" ];then if [ "" = "$OSNAME" ];then
OSNAME=`cat ${rootPath}/data/osname.pl` OSNAME=`cat ${rootPath}/data/osname.pl`
fi fi
if [ "macos" == "$OSNAME" ];then if [ "macos" = "$OSNAME" ];then
echo "不支持Macox" echo "不支持Macox"
exit exit
fi fi
@@ -78,7 +78,7 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -37,7 +37,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -37,7 +37,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+2 -2
View File
@@ -10,7 +10,7 @@ sourcePath=${serverPath}/source
sysName=`uname` sysName=`uname`
debian_suffix= debian_suffix=
if [ "$SYS_ARCH" == "aarch64" ];then if [ "$SYS_ARCH" = "aarch64" ];then
debian_suffix="-arm64" debian_suffix="-arm64"
fi fi
@@ -45,7 +45,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -38,7 +38,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -37,7 +37,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+2 -2
View File
@@ -14,7 +14,7 @@ SYS_ARCH=`arch`
SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
ubuntu_suffix= ubuntu_suffix=
if [ "$SYS_ARCH" == "aarch64" ];then if [ "$SYS_ARCH" = "aarch64" ];then
ubuntu_suffix="-arm64" ubuntu_suffix="-arm64"
fi fi
@@ -51,7 +51,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -37,7 +37,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -37,7 +37,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+2 -2
View File
@@ -11,7 +11,7 @@ sysName=`uname`
sysArch=`arch` sysArch=`arch`
debian_suffix= debian_suffix=
if [ "$sysArch" == "aarch64" ];then if [ "$sysArch" = "aarch64" ];then
debian_suffix="-arm64" debian_suffix="-arm64"
fi fi
@@ -50,7 +50,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -52,7 +52,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -38,7 +38,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+2 -2
View File
@@ -12,7 +12,7 @@ sysName=`uname`
sysArch=`arch` sysArch=`arch`
ubuntu_suffix= ubuntu_suffix=
if [ "$sysArch" == "aarch64" ];then if [ "$sysArch" = "aarch64" ];then
ubuntu_suffix="-arm64" ubuntu_suffix="-arm64"
fi fi
SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` SYS_VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
@@ -52,7 +52,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+3 -3
View File
@@ -22,11 +22,11 @@ echo "use system: ${sysName}"
OSNAME=`bash ${rootPath}/scripts/getos.sh` OSNAME=`bash ${rootPath}/scripts/getos.sh`
if [ "" == "$OSNAME" ];then if [ "" = "$OSNAME" ];then
OSNAME=`cat ${rootPath}/data/osname.pl` OSNAME=`cat ${rootPath}/data/osname.pl`
fi fi
if [ "macos" == "$OSNAME" ];then if [ "macos" = "$OSNAME" ];then
echo "不支持Macox" echo "不支持Macox"
exit exit
fi fi
@@ -71,7 +71,7 @@ Uninstall_App()
} }
action=$1 action=$1
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -33,7 +33,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -36,7 +36,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -37,7 +37,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -34,7 +34,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
@@ -37,7 +37,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -35,7 +35,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App
+1 -1
View File
@@ -44,7 +44,7 @@ Uninstall_App()
} }
action=${1} action=${1}
if [ "${1}" == 'install' ];then if [ "${1}" = 'install' ];then
Install_App Install_App
else else
Uninstall_App Uninstall_App