Option
Script
function isinstalled {
if yum list installed | grep "$@"; then
true
else
false
fi
}
RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
if isinstalled "ntp"; then
echo "Install ntp .......... [${GREEN}OK${RESET}]";
else
yum install ntp -y;
mv /etc/localtime /etc/localtime.bak
ln -s /usr/share/zoneinfo/Asia/Bangkok /etc/localtime
ntpd
chkconfig ntpd on
echo "Install ntp .......... [${GREEN}Installed${RESET}]";
fi