fix defect #4245 In rhels 7 env,setupntp script will show error message

This commit is contained in:
immarvin 2014-08-12 08:36:44 -07:00
parent 9b707af3b9
commit c86b4bda96

View File

@ -166,11 +166,15 @@ restrict 127.0.0.1" >>$conf_file
elif [ -f "/etc/debian_version" ];then
sed -i 's/.*UTC.*/UTC=yes/' /etc/default/rcS
else
grep -i "utc" /etc/sysconfig/clock
if [ $? -eq 0 ];then
sed -i 's/.*UTC.*/UTC=yes/' /etc/sysconfig/clock
else
echo "UTC=yes" >> /etc/sysconfig/clock
if [ -f "/etc/sysconfig/clock" ];then
grep -i "utc" /etc/sysconfig/clock
if [ $? -eq 0 ];then
sed -i 's/.*UTC.*/UTC=yes/' /etc/sysconfig/clock
else
echo "UTC=yes" >> /etc/sysconfig/clock
fi
elif type -P timedatectl >/dev/null 2>&1 ;then
timedatectl set-local-rtc 0
fi
fi