Annotation of /trunk/mkinitrd-magellan/busybox/examples/var_service/ntpd/ntp.script
Parent Directory | Revision Log
Revision 984 -
(hide annotations)
(download)
Sun May 30 11:32:42 2010 UTC (13 years, 11 months ago) by niro
File size: 1027 byte(s)
Sun May 30 11:32:42 2010 UTC (13 years, 11 months ago) by niro
File size: 1027 byte(s)
-updated to busybox-1.16.1 and enabled blkid/uuid support in default config
1 | niro | 984 | #!/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 | |||
11 | dt=`date '+%Y-%m-%d %H:%M:%S'` | ||
12 | |||
13 | if 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 | ||
28 | fi | ||
29 | |||
30 | echo "`tail -n 199 -- "$0.log" 2>/dev/null`" >"$0.log.$$" | ||
31 | echo "$dt: $1"\ | ||
32 | "freq_drift_ppm=$freq_drift_ppm"\ | ||
33 | "offset=$offset"\ | ||
34 | "stratum=$stratum"\ | ||
35 | "poll_interval=$poll_interval"\ | ||
36 | >>"$0.log.$$" | ||
37 | mv -- "$0.log.$$" "$0.log" |
Properties
Name | Value |
---|---|
svn:executable | * |