Commit 6244914e authored by Benoit Rat's avatar Benoit Rat

init.d: wr_date: readback NTP offset to check if WR time is properly set-

The return offset is only display so that we can check its value if the
user send us back the log but it is not used in any other way.
parent 7c0d1f11
......@@ -25,6 +25,17 @@ ntp_retries()
return 1
}
ntp_get_offset()
{
S=$1
F=/tmp/ntp_offset
ntpd -n -w -p ${S} 2> ${F} &
sleep 5
killall ntpd
tail -1 ${F} | sed 's/.*offset:\([^ ]*\).*/\1/'
#rm ${F} 2>&1 /dev/null
}
gm_wait_lock()
{
gm_ntries=${1:-15}
......@@ -66,6 +77,11 @@ ntp_to_hwclk()
date_set=1
#Enable back white rabbit as clock source
echo "white-rabbit" > ${CCS}
#Readback NTP offset
sleep 1
offset=$(ntp_get_offset $S)
echo "NTP offset = ${offset} s"
fi
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment