doxcat: the ntp -c rv 0 offset may return negative number

This commit is contained in:
ligc 2014-03-26 16:00:12 -05:00
parent 1407ef0288
commit 045c42fce6

View File

@ -105,7 +105,7 @@ ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|
ntpd -g -x
# rv 0 state does not work with the new ntp versions
#(while ! ntpq -c "rv 0 state"|grep 'state=4' > /dev/null; do sleep 1; done; hwclock --systohc) &
(while [ "`ntpq -c \"rv 0 offset\" | grep \"offset=\" | awk -F \"=\" '{print $2}' | awk -F \".\" '{print $1}'`" -ge 1000 ]; do sleep 1; done; hwclock --systohc) &
(while [ "`ntpq -c \"rv 0 offset\" | grep \"offset=\" | awk -F \"=\" '{print $2}' | awk -F \".\" '{print $1}' | sed s/-//`" -ge 1000 ]; do sleep 1; done; hwclock --systohc) &
if dmidecode|grep IPMI > /dev/null; then
modprobe ipmi_si
modprobe ipmi_devintf