代码拉取完成,页面将自动刷新
#!/bin/bash
# Install software for kvm instance.
# Athor: daihaijun
WORK_DIR=/root/tools
mkdir -p /home/{app,web}
cd $WORK_DIR;
# JAVA
if [ -d /usr/local/java ];then
echo "Java already exist"
break
else
tar zxf jdk1.8.0_92.tar.gz
mv jdk1.8.0_92 /usr/local/
ln -s /usr/local/jdk1.8.0_92 /usr/local/java
ln -s /usr/local/bin/java /bin/java
cat >>/etc/profile <<-EOF
JAVA_HOME=/usr/local/java
PATH=\$PATH:\$JAVA_HOME/bin
EOF
fi
# Tomcat
[ -d /home/web/tomcat7 ] && echo "Tomcat already exist." || {
tar zxf tomcat7.tar.gz && mv tomcat7 /home/web/
}
# GIT
[ -f /usr/local/bin/git ] && echo "git already exist." || {
unzip git.zip && cd git-master
autoconf
./configure --prefix=/usr/local && make && make install
/usr/local/bin/git --version && ln -s /usr/local/bin/git /usr/bin/git
}
cd $WORK_DIR;
#maven
[ -d /usr/local/apache-maven ] && echo "maven already exist." || {
M2_HOME=/usr/local/apache-maven
tar zxf apache-maven-3.3.9-bin.tar.gz
mv apache-maven-3.3.9 /usr/local/
ln -s /usr/local/apache-maven-3.3.9 /usr/local/apache-maven
mv $M2_HOME/conf/settings.xml $M2_HOME/conf/settings.xml.bak
mv settings.xml settings.xml_bak
cat >>/etc/profile <<\EOF
M2_HOME=/usr/local/apache-maven
PATH=$PATH:$M2_HOME/bin
EOF
}
# Atop
[ -f /usr/bin/atop ] && echo "atop already exist." || {
yum install -y ncurses-devel
tar zxf atop-2.3.0.tar.gz && cd atop-2.3.0
make sysvinstall
cd ../
atop -V 1>/dev/null && echo "atop was successfully installed"
}
# ifstat
[ -f /usr/local/bin/ifstat ] && echo "ifstat already exist." || {
tar xzf ifstat-1.1.tar.gz
cd ifstat-1.1
./configure
make && make install
cd ../
ifstat -v 1>/dev/null && echo "ifstat was successfully installed"
}
# tsar
[ -d /usr/local/tsar ] && echo "tsar already exist." || {
unzip tsar.zip && cd tsar-master && make && make install
cd ../
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。