71 lines
1.9 KiB
Bash
71 lines
1.9 KiB
Bash
#!/bin/bash
|
||
#stop server
|
||
if [ $(id -u) -ne 0 ]; then
|
||
echo "ERROR:当前用户没有管理员权限,非管理员请用 sudo ./installer_linux.sh 命令执行"
|
||
exit
|
||
fi
|
||
|
||
#加载宏定义,用来判断平台
|
||
if [ -f "/etc/profile.d/iscs6000.sh" ]; then
|
||
source /etc/profile.d/iscs6000.sh
|
||
fi
|
||
if [ -f "/etc/profile.d/iscs6000env.sh" ]; then
|
||
source /etc/profile.d/iscs6000env.sh
|
||
fi
|
||
if [ -f "/etc/profile.d/rqeh6000.sh" ]; then
|
||
source /etc/profile.d/rqeh6000.sh
|
||
fi
|
||
if [ -f "/etc/profile.d/rqeh6000env.sh" ]; then
|
||
source /etc/profile.d/rqeh6000env.sh
|
||
fi
|
||
|
||
|
||
#安装平台 centos 、openeuler
|
||
OS_DEFINE=""
|
||
#nginx 定制系统配置目录 以及服务名称
|
||
NGINX_CONFIGDIR=""
|
||
NGINX_SERVICE_NAME=""
|
||
|
||
if [ -n "$RQEH6000_OS" ]; then
|
||
OS_DEFINE=$RQEH6000_OS
|
||
echo "INFO:安装操作系统平台:" $RQEH6000_OS
|
||
fi
|
||
if [ -n "$ISCS6000_OS" ]; then
|
||
OS_DEFINE=$ISCS6000_OS
|
||
echo "INFO:安装操作系统平台:" $ISCS6000_OS
|
||
fi
|
||
|
||
if [ "oe2203" = "$OS_DEFINE" ] || [ "kylin10d" = "$OS_DEFINE" ]; then
|
||
NGINX_CONFIGDIR="/etc/nginx/nginx.conf"
|
||
NGINX_SERVICE_NAME="nginx"
|
||
echo "INFO:nginx配置文件:"$NGINX_CONFIGDIR "服务名称" $NGINX_SERVICE_NAME
|
||
else
|
||
NGINX_CONFIGDIR="/etc/opt/rh/rh-nginx116/nginx/nginx.conf"
|
||
NGINX_SERVICE_NAME="rh-nginx116-nginx"
|
||
echo "INFO:nginx配置文件:"$NGINX_CONFIGDIR "服务名称" $NGINX_SERVICE_NAME
|
||
fi
|
||
|
||
systemctl stop mariadb.service
|
||
systemctl disable mariadb.service
|
||
systemctl stop mysqld.service
|
||
systemctl disable mysqld.service
|
||
systemctl stop influxdb
|
||
systemctl disable influxdb
|
||
systemctl stop ${NGINX_SERVICE_NAME}
|
||
systemctl disable ${NGINX_SERVICE_NAME}
|
||
systemctl stop kingbase
|
||
systemctl disable kingbase
|
||
systemctl stop net_keepalived
|
||
systemctl disable net_keepalived
|
||
|
||
if [ "oe2203" = "$OS_DEFINE" ]; then
|
||
systemctl stop opengauss
|
||
systemctl disable opengauss
|
||
fi
|
||
|
||
|
||
if [ -L "$NGINX_CONFIGDIR" ]; then
|
||
sudo rm -f "$NGINX_CONFIGDIR"
|
||
echo "Symbolic link $NGINX_CONFIGDIR remove"
|
||
fi
|