|
|
|
@ -62,6 +62,33 @@ createDatabase(){
|
|
|
|
|
sleep 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#################### 安装NTP ###################################################
|
|
|
|
|
installNTP(){
|
|
|
|
|
echo "************[installing NTP]正在安装NTP >>>>>>>>>>>>>"
|
|
|
|
|
echo ""
|
|
|
|
|
if [ ! `rpm -qa | grep ntp- | wc -l` -ne 0 ]; then
|
|
|
|
|
rpm -ivh package/ntp-4.2.6p5-29.el7.centos.2.x86_64.rpm
|
|
|
|
|
sleep 1
|
|
|
|
|
fi
|
|
|
|
|
sed -i 's/^[^#]*server 0.centos.pool.ntp.org iburst*/#&/g' /etc/ntp.conf
|
|
|
|
|
sed -i 's/^[^#]*server 1.centos.pool.ntp.org iburst*/#&/g' /etc/ntp.conf
|
|
|
|
|
sed -i 's/^[^#]*server 2.centos.pool.ntp.org iburst*/#&/g' /etc/ntp.conf
|
|
|
|
|
sed -i 's/^[^#]*server 3.centos.pool.ntp.org iburst*/#&/g' /etc/ntp.conf
|
|
|
|
|
|
|
|
|
|
if [ `grep --color=auto -c "server 127.127.1.0" /etc/ntp.conf` == '0' ]; then
|
|
|
|
|
sed -i '/server 3.centos.pool.ntp.org iburst/a\\nserver 127.127.1.0' /etc/ntp.conf
|
|
|
|
|
sed -i '/server 127.127.1.0/a fudge 127.127.1.0 stratum' /etc/ntp.conf
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
systemctl restart ntpd
|
|
|
|
|
sleep 1
|
|
|
|
|
echo " 重启NTP ..."
|
|
|
|
|
echo ""
|
|
|
|
|
systemctl disable chronyd
|
|
|
|
|
systemctl enable ntpd
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#################### 安装OpenJDK ################################################
|
|
|
|
|
installJDK(){
|
|
|
|
|
echo "************[prepare to install OpenJDK]准备开始装OpenJDK >>>>>>>>>>>>>"
|
|
|
|
@ -334,6 +361,10 @@ if [ ! -e "/etc/rc.d/rc.local" ]; then
|
|
|
|
|
fi
|
|
|
|
|
chmod +x /etc/rc.d/rc.local
|
|
|
|
|
|
|
|
|
|
if [ $NTP_INS == 1 ]; then
|
|
|
|
|
installNTP
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ $MYSQL_INS == 1 ]; then
|
|
|
|
|
installDatabase
|
|
|
|
|
fi
|
|
|
|
|