1. 程式人生 > >shell腳本安裝ntp server 服務

shell腳本安裝ntp server 服務

cat color start AR pre yum pac clas basepath

##############################Deploy ntp server ########################
echo "start deploy ntp server"
 
yum install -y ntp
 
if [ ! -f /var/log/ntpd.log  ];then
      touch /var/log/ntpd.log
fi
 
chown ntp:ntp /var/log/ntpd.log
 
cat $basepath/package/ntp.conf > /etc/ntp.conf
 
systemctl restart ntpd
systemctl enable ntpd
 
ntppid
=`ps aux|grep ntp|grep -v "grep"|awk {print $2}` if [ "$ntppid" ];then echo "success ! ntp-server is running now" fi

shell腳本安裝ntp server 服務