source: MondoRescue/branches/2.2.9/mindi-busybox/examples/var_service/ntpd/ntp.script@ 2725

Last change on this file since 2725 was 2725, checked in by Bruno Cornec, 13 years ago
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
  • Property svn:executable set to *
File size: 1.0 KB
Line 
1#!/bin/sh
2
3# Note that there is no provision to prevent several copies of the script
4# to be run in quick succession. In fact, it happens rather often
5# if initial syncronization results in a step.
6# You will see "step" and then "stratum" script runs, sometimes
7# as close as only 0.002 seconds apart.
8#
9# Script should be ready to deal with this.
10
11dt=`date '+%Y-%m-%d %H:%M:%S'`
12
13if test x"$stratum" != x"" \
14&& test x"$poll_interval" != x"" \
15&& test 4 -ge "$stratum" \
16&& test 128 -le "$poll_interval" \
17; then
18 echo "`tail -n 199 -- "$0.log" 2>/dev/null`" >"$0.log.$$"
19 echo "$dt: $1"\
20 "freq_drift_ppm=$freq_drift_ppm"\
21 "offset=$offset"\
22 "stratum=$stratum"\
23 "poll_interval=$poll_interval,"\
24 "setting hardware clock"\
25 >>"$0.log.$$"
26 mv -- "$0.log.$$" "$0.log"
27 exec hwclock --systohc
28fi
29
30echo "`tail -n 199 -- "$0.log" 2>/dev/null`" >"$0.log.$$"
31echo "$dt: $1"\
32 "freq_drift_ppm=$freq_drift_ppm"\
33 "offset=$offset"\
34 "stratum=$stratum"\
35 "poll_interval=$poll_interval"\
36 >>"$0.log.$$"
37mv -- "$0.log.$$" "$0.log"
Note: See TracBrowser for help on using the repository browser.