linux服务安装(初始化)脚本

系统优化要根据需求修改(1:zabbix.conf| 2:iptables| 3:snmp.conf|4: ssh_port| 5:ntpserver| 6:yum repo)等配置
脚本中需要的软件可以到下面地址下载
链接:https://pan.baidu.com/s/1i5u3ZVJ 密码:nytn
软件默认安装到/opt下面
软件包放在/tmp/inbag/下面即可

#!/bin/bash
#This script is for auto install app
#Auth:luobin
#Date:2017/12/18
#各种安装包放在${downdir}下面,安装路径为/opt
RED_COLOR='\E[1;31m'
GREEN_COLOR='\E[1;32m'
YELLOW_COLOR='\E[1;33m'
BLUE_COLOR='\E[1;34m'
RES='\E[0m'

###################################################修改变量区############################################################################

#安装路径
insdir='/opt/'
#软件包下载路径
ftpdir='ftp://10.1.1.1/pub/inbag/'
#软件包存放本地路径
downdir='/tmp/inbag'

############################################################################################################################################
init(){
read -p "是否要配置yum源(y|n): " yn
read -p "请输入要设置的主机名: " host
read -p "请输入你要添加路由的网关: " gateway1 
####################IP######################################
IPADDR=`ifconfig|grep -Po '(\d+\.){3}\d+'|awk '/10\./'|awk 'NR==1'`
####################ssh port###############################
sed -i 's/\#Port 22/Port 2202/g' /etc/ssh/sshd_config
sed -i 's/\#ListenAddress 0.0.0.0/ListenAddress '"$IPADDR"'/g' /etc/ssh/sshd_config
sed -i 's/\#PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config
sed -i 's/GSSAPIAuthentication yes/GSSAPIAuthentication no/g' /etc/ssh/sshd_config
sed -i 's/X11Forwarding yes/X11Forwarding no/g' /etc/ssh/sshd_config
sed -i 's/\#UseDNS yes/UseDNS no/g' /etc/ssh/sshd_config
####################selinux off###########################
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config 
setenforce 0
#######################history format####################
hfm=`grep HISTTIMEFORMAT  ~/.bashrc |wc -l`
[ $hfm -eq 0 ] && echo 'HISTTIMEFORMAT="`whoami`: %F %T :"' >> ~/.bashrc
####################route-auto##########################
if [ `uname -r | awk -F'.' '{print $4}'` = 'el7' ]; then
    hostnamectl set-hostname $host
    systemctl stop firewalld && systemctl disable firewalld
    netname=`ifconfig | egrep -w 'eth1|br2'|awk '{print $1}'`
    route add -net 10.0.0.0/8 gw $gateway1
    route add -net 192.168.1.0/24 gw $gateway1
    [ -f /etc/sysconfig/network-scripts/route-$netname ]||echo -e "10.0.0.0/8 via $gateway1 dev ${netname}\n192.168.8.0/24 via $gateway1 dev $netname" >/etc/sysconfig/network-scripts/route-$netname
else
    hostname $host
    sed -i "2c HOSTNAME=$host" /etc/sysconfig/network
    route add -net 10.0.0.0/8 gw $gateway1
    route add -net 192.168.1.0/24 gw $gateway1
    [ -f /etc/sysconfig/static-routes ] || echo -e "any net 10.0.0.0/8 gw ${gateway1}\nany net 192.168.8.0/24 gw $gateway1" >/etc/sysconfig/static-routes
fi
####################IPTABLES##########################
cat >/etc/sysconfig/iptables <<EOF
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
#######company IP####公司外网IP
-A RH-Firewall-1-INPUT -s 101.100.100.100 -j ACCEPT
#######Intranet IP####
-A RH-Firewall-1-INPUT -s 10.0.0.0/8 -j ACCEPT
-A RH-Firewall-1-INPUT -s 192.168.1.0/24 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --sport 53 -j ACCEPT
##########Application port#######

###################################
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
EOF

cat >/etc/sysctl.conf <<EOF
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_max_syn_backlog = 4096
net.core.netdev_max_backlog =  10240
net.core.somaxconn = 2048
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_mem = 94500000 915000000 927000000
EOF

sysctl -p

mv /etc/security/limits.conf /etc/security/limits.confbak
cat >/etc/security/limits.conf<<EOF
  *   -   nproc   102400
  *   -   nofile  102400
EOF

################yum repo################################
if [ "$yn" = y ];then
[ -d /etc/yum.repos.d/bak ] || mkdir /etc/yum.repos.d/bak
mv /etc/yum.repos.d/CentOS-* /etc/yum.repos.d/bak
cat >/etc/yum.repos.d/iso.repo <<EOF
[iso]
name=centos
baseurl=ftp://10.1.1.1/pub/centos6.5
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS6
EOF
else [ "$yn" = n ]
	echo "Not setting yum repo"
fi

yum clean all

yum install  -y ntp \
            net-snmp.x86_64 \
            net-snmp-python.x86_64 \
			net-snmp-devel.x86_64 \
			net-snmp-utils.x86_64 \
			gcc \
			gcc-c++ \
			cmake \
			xmlto \
			ncurses \
			ncurses-libs.x86_64 \
            ncurses-devel.x86_64 \
            gdbm-devel.x86_64 \
            sqlite-devel.x86_64  \
            readline-devel.x86_64  \
            python-setuptools.noarch \
			zlib-devel.x86_64 \
			libxml2-devel \
			libxslt-devel \
			libaio-devel \
			zip \
			unzip \
            wget \
            git	\
            telnet
check=`echo $?`
if [ $check -ne 0 ];then
echo "yum源有问题,请查看"
fi

ntpdate 10.1.1.1

##################Ƥ׃snmpƤ׃###################
cat >/etc/snmp/snmpd.conf<<EOF
rocommunity snmp@iwgame.com 127.0.0.1/32
rocommunity snmp@iwgame.com 10.1.0.0/16
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
view systemview included .1.3.6.1.4.1.2208
access notConfigGroup "" any noauth exact all none none
view all included .1 80
syslocation iwgame.com (edit /etc/snmp/snmpd.conf)
syscontact Root <snmp@iwgame.com> (configure /etc/snmp/snmp.local.conf)
EOF

if [ `uname -r | awk -F'.' '{print $4}'` = 'el7' ]; then
    systemctl restart sshd.service
    systemctl restart iptables.service
else
    /etc/init.d/sshd restart
    /etc/init.d/iptables restart
fi

useradd master
echo iwgame |passwd master --stdin

[ -f /var/spool/cron/root ] || touch /var/spool/cron/root
cront=`grep -Ec "ntpdate|tables" /var/spool/cron/root`
if [ $cront -ne 2 ];then
echo '*/10 * * * * /etc/init.d/iptables status 2>&1>/dev/null || /etc/init.d/iptables start 2>&1>/dev/null' >> /var/spool/cron/root
echo '*/5 * * * * /usr/sbin/ntpdate 10.1.1.1' >> /var/spool/cron/root
fi
echo 'nameserver 114.114.114.114' >/etc/resolv.conf
}

download(){
  read -p "是否要限速(y|n):" netspeed
	[ -d ${downdir} ] || mkdir ${downdir}
	cd ${downdir}
}

zabbix_install(){
############download#############################
read -p "是否要下载软件包(y|n):" package
if [ $package = "y" ];then
    if [ $netspeed = "y" ];then
        wget -c --limit-rate=1800k ${ftpdir}zabbix.tar.gz
    else [ $netspeed = "n" ]
        wget -c ${ftpdir}zabbix.tar.gz
    fi
else [ $package = "n" ]
    echo "跳过下载软件包"
fi
############dinstall#############################
cd ${downdir}
tar -xf ${downdir}/zabbix.tar.gz
dir=${downdir}/zabbix
cd $dir
rpm -ivh *.rpm --force --nodeps
iptables -I INPUT -s 10.1.1.10 -p tcp --dport 10050 -j ACCEPT
groupadd zabbix
useradd -r -s /sbin/nologin -g zabbix zabbix
mkdir /var/log/zabbix
chown -R zabbix.zabbix /var/log/zabbix
mkdir /var/run/zabbix
chown -R zabbix.zabbix /var/run/zabbix
self=`hostname`

cat >/etc/zabbix/zabbix_agentd.conf<<EOF
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=10.1.1.10
ServerActive=10.1.1.10
Hostname=$self
Include=/etc/zabbix/zabbix_agentd.d/
#UserParameter=
EOF

/etc/init.d/zabbix-agent restart
chkconfig zabbix-agent on
}


jdk_ins()
{
############download#############################
read -p "是否要下载软件包(y|n):" package
if [ $package = "y" ];then
    if [ $netspeed = "y" ];then
        wget -c --limit-rate=1800k ${ftpdir}jdk-6u37-linux-x64.bin
    else [ $netspeed = "n" ]
        wget -c ${ftpdir}jdk-6u37-linux-x64.bin
        chmod 777 ${downdir}/jdk-6u37-linux-x64.bin
    fi
else [ $package = "n" ]
    echo "跳过下载软件包"
fi
############install#############################
cd ${insdir}
cp ${downdir}/jdk-6u37-linux-x64.bin .
./jdk-6u37-linux-x64.bin
mv jdk1.6.0_37 jdk
rm -f jdk-6u37-linux-x64.bin
echo "export JAVA_HOME=${insdir}jdk" >> /etc/profile
echo "export JRE_HOME=${insdir}jdk/jre" >> /etc/profile
echo 'export PATH=$PATH:'${insdir}'jdk/bin'  >> /etc/profile
}

jdk7_ins(){
############download#############################
read -p "是否要下载软件包(y|n):" package
if [ $package = "y" ];then
    if [ $netspeed = "y" ];then
        wget -c --limit-rate=1800k ${ftpdir}jdk-7u79-linux-x64.tar.gz
    else [ $netspeed = "n" ]
        wget -c ${ftpdir}jdk-7u79-linux-x64.tar.gz	
    fi
else [ $package = "n" ]
    echo "跳过下载软件包"
fi
############dinstall#############################
cd ${insdir}
cp ${downdir}/jdk-7u79-linux-x64.tar.gz .
tar xf jdk-7u79-linux-x64.tar.gz
mv jdk1.7.0_79 jdk1.7
rm -f jdk-7u79-linux-x64.tar.gz
#echo "export JAVA_HOME=${insdir}jdk" >> /etc/profile
#echo "export JRE_HOME=${insdir}jdk/jre" >> /etc/profile
#echo 'export PATH=$PATH:'${insdir}'jdk/bin'  >> /etc/profile
}

rabbitmq_ins()
{
############download#############################
read -p "是否要下载软件包(y|n):" package
if [ $package = "y" ];then
    if [ $netspeed = "y" ];then
		wget -c --limit-rate=1800k ${ftpdir}otp_src_R15B.tar.gz
		wget -c --limit-rate=1800k ${ftpdir}rabbitmq-server-3.2.4.tar.gz
	else [ $netspeed = "n" ]
		wget -c ${ftpdir}otp_src_R15B.tar.gz
		wget -c ${ftpdir}rabbitmq-server-3.2.4.tar.gz	
	fi
else [ $package = "n" ]
    echo "跳过下载软件包"
fi
############install#############################
	cd ${downdir}/
	tar xf otp_src_R15B.tar.gz 
	cd ${downdir}/otp_src_R15B
./configure 
if [ $? -eq 0 ];then
   make && make install
fi  
	cd ${downdir}/
	tar xf rabbitmq-server-3.2.4.tar.gz                      
	cd ${downdir}/rabbitmq-server-3.2.4
	make TARGET_DIR=${insdir}rabbitmq SBIN_DIR=${insdir}rabbitmq/sbin MAN_DIR=${insdir}rabbitmq/man DOC_INSTALL_DIR=${insdir}rabbitmq/doc install
    mkdir -p /etc/rabbitmq/
   	cd ${insdir}rabbitmq/sbin/
   	./rabbitmq-plugins enable rabbitmq_management
}

mysql_ins()
{
	MYSQL_PATH=${downdir}/mariadb-5.5.34
	useradd	-s /sbin/nologin mysql
	cd ${downdir}
	tar zvxf mariadb-5.5.34.tar.gz
	cd mariadb-5.5.34
cmake . -DCMAKE_INSTALL_PREFIX=${insdir}mysql\
		-DWITH_INNOBASE_STORAGE_ENGINE=1\
		-DWITH_FEDERATED_STORAGE_ENGINE=1\
		-DENABLED_LOCAL_INFILE=1\
		-DEXTRA_CHARSETS=all\
		-DDEFAULT_CHARSET=utf8\
		-DDEFAULT_COLLATION=utf8_general_ci\
		-DWITH_DEBUG=0\
		-DBUILD_CONFIG=mysql_release\
		-DFEATURE_SET=community\
		-DWITH_EMBEDDED_SERVER=OFF
if [ $? -eq 0 ];then
	make && make install
fi
chown -R mysql.mysql ${insdir}mysql
ln -s ${insdir}mysql/bin/* /usr/bin/
${insdir}mysql/scripts/mysql_install_db --basedir=${insdir}mysql/ --datadir=${insdir}mysql/data/ --user=mysql
####################Start file##########################################
   /bin/cp ${MYSQL_PATH}/support-files/my-large.cnf /etc/my.cnf
   /bin/cp ${MYSQL_PATH}/support-files/mysql.server /etc/init.d/mysqld
   sed -i '/skip-locking/a\datadir=${insdir}mysql' /etc/my.cnf
   chmod 755 /etc/init.d/mysqld 
   chkconfig --add mysqld
   chkconfig mysqld on
}

mysql_new_ins(){
############download#############################
read -p "是否要下载软件包(y|n):" package
if [ $package = "y" ];then
    if [ $netspeed = "y" ];then
        wget -c --limit-rate=1800k ${ftpdir}mariadb-5.5.58-linux-x86_64.tar.gz

    else [ $netspeed = "n" ]
        wget -c ${ftpdir}mariadb-5.5.58-linux-x86_64.tar.gz	
    fi
else [ $package = "n" ]
    echo "跳过下载软件包"
fi
############install#############################
useradd -s /sbin/nologin mysql
cd ${downdir}
tar -xf mariadb-5.5.58-linux-x86_64.tar.gz -C ${insdir}
cd /opt
mv mariadb-5.5.58-linux-x86_64 mariadb
cd ${insdir}mariadb/scripts
./mysql_install_db --basedir=${insdir}mariadb/ --datadir=${insdir}mariadb/data/ --user=mysql
cd ..
cp support-files/my-large.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
sed -i '/skip-external-locking/a\datadir=${insdir}mariadb/data' /etc/my.cnf
sed -i '/skip-external-locking/a\basedir=${insdir}mariadb' /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
chown -R mysql.mysql ${insdir}mariadb
sed -i '47s#datadir=#datadir=${insdir}mariadb/data#' /etc/init.d/mysqld
sed -i '46s#basedir=#basedir=${insdir}mariadb#' /etc/init.d/mysqld
ln -s ${insdir}mariadb/bin/* /usr/bin/
chkconfig --add mysqld
chkconfig mysqld on
}

nginx_ins()
{
############download#############################
read -p "是否要下载软件包(y|n):" package
if [ $package = "y" ];then
    if [ $netspeed = "y" ];then
        wget -c --limit-rate=1800k ${ftpdir}libunwind-1.1.tar.gz
        wget -c --limit-rate=1800k ${ftpdir}gperftools-2.1.tar.gz
        wget -c --limit-rate=1800k ${ftpdir}pcre-8.34.zip
        wget -c --limit-rate=1800k ${ftpdir}nginx-1.13.3.tar.gz
    else [ $netspeed = "n" ]
        wget -c ${ftpdir}libunwind-1.1.tar.gz
        wget -c ${ftpdir}gperftools-2.1.tar.gz
        wget -c ${ftpdir}pcre-8.34.zip
        wget -c ${ftpdir}nginx-1.13.3.tar.gz
    fi
else [ $package = "n" ]
    echo "跳过下载软件包"
fi

############install libunwind#####################
	cd ${downdir}
	tar zxvf libunwind-1.1.tar.gz
	cd libunwind-1.1
   ./configure 
if [ $? -eq 0 ];then
	make && make install
fi

############install gperftools####################
   cd ${downdir}
   tar xvzf gperftools-2.1.tar.gz 
   cd gperftools-2.1
   ./configure --disable-heap-checker --disable-debugalloc --enable-frame-pointers
if [ $? -eq 0 ];then
	make && make install
fi
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
echo "/usr/lib" >> /etc/ld.so.conf.d/usr_local_lib.conf
echo "/usr/lib64" >> /etc/ld.so.conf.d/usr_local_lib.conf
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/usr_local_lib.conf
/sbin/ldconfig

############install pcre##########################
	cd ${downdir}
	unzip pcre-8.34.zip
	cd pcre-8.34
	./configure --enable-utf8
if [ $? -eq 0 ];then
	make && make install
fi

############install nginx#########################
cd ${downdir}
tar xf nginx-1.13.3.tar.gz
cd nginx-1.13.3
./configure \
--user=www \
--group=www \
--prefix=${insdir}nginx \
--with-poll_module \
--with-file-aio \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-google_perftools_module \
--with-cpu-opt=opteron \
--with-pcre \
--with-select_module \
--with-http_xslt_module \
--without-http-cache \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--with-http_ssl_module \
--with-http_realip_module 
if [ $? -eq 0 ];then
	make && make install
fi
mkdir ${insdir}nginx/conf/vhost
cp /usr/local/lib/libpcre.so.1 /lib64/
#cp ${downdir}/nginx /etc/init.d/
useradd -s /sbin/nologin www
sed -i '79 a\include vhost/*.conf\;' ${insdir}nginx/conf/nginx.conf
}

redis_ins(){
############download#############################
read -p "是否要下载软件包(y|n):" package
if [ $package = "y" ];then
    if [ $netspeed = "y" ];then
		wget -c --limit-rate=1800k ${ftpdir}redis-2.8.3.tar.gz
	else [ $netspeed = "n" ]
		wget -c ${ftpdir}redis-2.8.3.tar.gz
	fi
else [ $package = "n" ]
    echo "跳过下载软件包"
fi
############install#############################
	cd ${downdir}
	tar zxvf redis-2.8.3.tar.gz
	cd redis-2.8.3
	make
	cd src/
	make install PREFIX=${insdir}redis
	rm -rf redis-2.8.3
	cd ${insdir}redis && mkdir {etc,log,run}
}

zeromq_ins(){
############download#############################
read -p "是否要下载软件包(y|n):" package
if [ $package = "y" ];then
    if [ $netspeed = "y" ];then
        wget -c --limit-rate=1800k ${ftpdir}zeromqbag.tar.gz
    else [ $netspeed = "n" ]
        wget -c ${ftpdir}zeromqbag.tar.gz
    fi
else [ $package = "n" ]
    echo "跳过下载软件包"
fi
############install#############################
yum install -y curl-devel \
               expat-devel \
               gettext-devel \
               openssl-devel \
               zlib-devel \
               perl-devel \
               libtool \ 
               automake \
               libsodium-devel \
               openpgm-devel
dir='${downdir}/zeromqinbag'
cd ${downdir}
tar xf zeromqbag.tar.gz

cd $dir
rpm -ivh *.rpm
tar xf zeromq-4.1.3.tar 
cd zeromq-4.1.3

bash autogen.sh
./configure -with-pgm=libpgm-5.2.122~dfsg
make
make install
if [ $? -eq 0 ];then
#envir
echo /usr/local/lib >/etc/ld.so.conf.d/local.conf
ldconfig
echo CLASSPATH=/usr/local/share/java/zmq.jar:. >> /etc/environment 
source /etc/environment
echo export LD_LIBRARY_PATH=/usr/local/lib >/etc/profile.d/ldlibrarypath.sh 
source /etc/profile.d/ldlibrarypath.sh

echo "LD_LIBRARY_PATH=/usr/local/lib" >> ~/.bash_profile 
echo "export LD_LIBRARY_PATH" >> ~/.bash_profile 

source  ~/.bash_profile
#jzmq
cd $dir
tar xf jzmq.tar.gz
cd jzmq
bash autogen.sh
./configure
make
make install

#check install is/no success
    if [ `ls /usr/local/lib | grep zmq | wc -l` -eq 10 ]; then
        echo 'all is ok!! 安装zeromq成功'
    else
        echo 'something faild!! 安装zeromq失败!!!'
    fi
fi
}

menu(){
        echo "-------------------------------------"
		echo -e "${RED_COLOR}1.系统优化${RES}"
		echo -e "${GREEN_COLOR}2.zabbix客户端安装${RES}"
        echo -e "${RED_COLOR}3.nginx一键安装${RES}"
        echo -e "${GREEN_COLOR}4.mysql一键安装${RES}"
        echo -e "${YELLOW_COLOR}5.rabbitmq一键安装${RES}"
        echo -e "${BLUE_COLOR}6.jdk一键安装${RES}"
        echo -e "${BLUE_COLOR}7.jdk1.7一键安装${RES}"
		echo -e "${RED_COLOR}8.redis一键安装${RES}"
		echo -e "${GREEN_COLOR}9.zeromq一键安装${RES}"
        echo "-------------------------------------"
}
install(){
read -p "Please enter the serial number:" name
case $name in
	1)
		init
		echo 
		echo "系统优化完成";;
	2)
        download
   		zabbix_install
		echo "zabbix_agent 安装完成";;
	3)
        download
		nginx_ins
		echo "run ${insdir}nginx/sbin/nginx  to start nginx.";;
	4)
        download
		mysql_new_ins
		echo "run /etc/init.d/mysqld start to start mysql.";;
	5)
        download
		rabbitmq_ins
		echo "run ${insdir}rabbitmq/sbin/rabbitmq-server -detached to start rabbitmq.";;
	6)
        download
		jdk_ins
		echo "remember run source /etc/profile.";;
	7)
        download
		jdk7_ins
		echo "remember run source /etc/profile.";;
	8)
        download
		redis_ins
		echo "redis安装完成,请手动修改配置文件";;
	9)
        download
		zeromq_ins
		echo "zaromq安装完成";;
	*)
		echo $"Usage:$0 {1:init|2:zabbix_agent|3:nginx|4:mysql|5:rabbitmq|6:jdk1.6|7:jdk1.7|8:redis|9:zeromq}";;
esac
}
main(){
        menu
        install
}
main
exit 0
posted @   彬彬l  阅读(88)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· AI 智能体引爆开源社区「GitHub 热点速览」
点击右上角即可分享
微信分享提示