]>
git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - ntp/ntpdate-wrapper
4 ntpstep
=/etc
/ntp
/step-tickers
6 [ "$EUID" != "0" ] && exit 4
7 [ -x /usr
/sbin
/ntpdate
] ||
exit 5
8 [ -f /etc
/sysconfig
/ntpdate
] ||
exit 6
9 .
/etc
/sysconfig
/ntpdate
11 [ -f $ntpstep ] && tickers
=$
(sed 's/#.*//' $ntpstep) || tickers
=
13 if ! echo "$tickers" |
grep -qi '[a-z0-9]' && [ -f $ntpconf ]; then
14 # the step-tickers file doesn't specify a server,
15 # use servers from ntp.conf instead
16 tickers
=$
(awk '$1=="peer"||$1=="server"{print $2}' $ntpconf | \
17 grep -Ev '127\.127\.[0-9]+\.[0-9]+')
20 if ! echo "$tickers" |
grep -qi '[a-z0-9]'; then
21 echo "NTP server not specified in $ntpstep or $ntpconf"
25 [ -z "$RETRIES" ] && RETRIES
=2
28 /usr
/sbin
/ntpdate
-U ntp
-s -b $OPTIONS $tickers &> /dev
/null
30 [ $RETVAL -eq 0 ] ||
[ $retry -ge "$RETRIES" ] && break
31 sleep $
[10 * (1 << $retry)]
35 [ $RETVAL -eq 0 ] && [ "$SYNC_HWCLOCK" = "yes" ] && /sbin
/hwclock --systohc