]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ntp/scripts/update-leap/update-leap-opts.def
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / ntp / scripts / update-leap / update-leap-opts.def
1 /* -*- Mode: Text -*- */
2 autogen definitions perlopt;
3
4 #include autogen-version.def
5
6 prog-name      = 'update-leap';
7 prog-title     = 'leap-seconds file manager/updater';
8 package         = ntp;
9 #include        version.def
10
11 long-opts;
12 gnu-usage;
13
14 flag = {
15     name        = source-url;
16     value       = s;
17     arg-type    = string;
18     descrip     = 'The URL of the master copy of the leapseconds file';
19     doc         = <<-  _EndOfDoc_
20         Specify the URL of the master copy to download
21         $LEAPSRC
22         _EndOfDoc_;
23 };
24 flag = {
25     name      = ipv4;
26     flags-cant = ipv6;
27     value     = 4;
28     descrip   = "Use only IPv4 addresses for DNS name resolution";
29     doc = <<-  _EndOfDoc_
30         Force DNS resolution of following host names on the command line
31         to the IPv4 namespace.
32         _EndOfDoc_;
33 };
34
35 flag = {
36     name      = ipv6;
37     flags-cant = ipv4, prefer;
38     value     = 6;
39     descrip   = "Use only IPv6 addresses for DNS name resolution";
40     doc = <<-  _EndOfDoc_
41         Force DNS resolution of following host names on the command line
42         to the IPv6 namespace.
43         _EndOfDoc_;
44 };
45
46 flag = {
47     name        = prefer;
48     flags-cant  = ipv4, ipv6;
49     value       = p;
50     arg-type    = keyword;
51     keyword     = 4, 6;
52     descrip     = 'Prefer IPv4 or IPv6 (as specified) addresses, but use either';
53     doc         = <<-  _EndOfDoc_
54         Prefer IPv4 or IPv6 (as specified) addresses, but use either.
55         _EndOfDoc_;
56 };
57
58 flag = {
59     name        = destination;
60     value       = d;
61     arg-type    = string;
62     arg-name    = float;
63     descrip     = 'Filename on the local system';
64     doc         = <<-  _EndOfDoc_
65         The name to use to store the leapfile on the local system.
66         $LEAPFILE
67         _EndOfDoc_;
68 };
69
70 flag = {
71     name        = expiration;
72     value       = e;
73     arg-type    = string;
74     descrip     = 'Refresh the leapfile this long before it expires';
75     doc         = <<-  _EndOfDoc_
76         Specify how long before expiration the file is to be refreshed
77         Units are required, e.g. "-e 60 days"  Note that larger values
78         imply more frequent refreshes.
79         "$PREFETCH"
80         _EndOfDoc_;
81 };
82
83 flag = {
84     name        = ntp-conf-file;
85     value       = f;
86     arg-type    = string;
87     descrip     = 'Location of the ntp.conf file';
88     doc         = <<-  _EndOfDoc_
89         Specify location of ntp.conf (used to make sure leapfile directive is
90         present and to default  leapfile)
91         /etc/ntp.conf
92         _EndOfDoc_;
93 };
94
95 flag = {
96     name        = force-update;
97     value       = F;
98     descrip     = 'Force update of the leapfile';
99     doc         = <<-  _EndOfDoc_
100         Force update even if current file is OK and not close to expiring.
101         _EndOfDoc_;
102 };
103
104 flag = {
105     name        = dont-wait;
106     descrip     = "Don't wait for keystroke between plots";
107     doc         = <<-  _EndOfDoc_
108         _EndOfDoc_;
109 };
110
111 /* explain: Additional information whenever the usage routine is invoked */
112 explain = <<- _END_EXPLAIN
113         _END_EXPLAIN;
114
115 doc-section     = {
116   ds-type       = 'DESCRIPTION';
117   ds-format     = 'mdoc';
118   ds-text       = <<- _END_PROG_MDOC_DESCRIP
119 .Nm
120 will validate the file currently on the local system
121 and if necessary, updates leap-second definition file.
122 .Pp
123 Ordinarily, the file is found using the "leapfile" directive in
124 .Xr ntp.conf 5 .
125 However, an alternate location can be specified on the command line.
126 .Pp
127 If the file does not exist, is not valid, has expired, or is expiring soon,
128 a new copy will be downloaded.  If the new copy validates, it is installed and
129 NTP is (optionally) restarted.
130 .Pp
131 If the current file is acceptable, no download or restart occurs.
132 .Pp
133 -c can also be used to invoke another script to perform administrative
134 functions, e.g. to copy the file to other local systems.
135 .PP
136 This can be run as a cron job.  As the file is rarely updated, and leap
137 seconds are announced at least one month in advance (usually longer), it
138 need not be run more frequently than about once every three weeks.
139 .PP
140 For cron-friendly behavior, define CRONJOB=1 in the crontab.
141 .PP
142 This script depends on$REQUIREDCMDS
143         _END_PROG_MDOC_DESCRIP;
144 };
145
146
147 doc-section     = {
148   ds-type       = 'USAGE';
149   ds-format     = 'mdoc';
150   ds-text       = <<- _END_MDOC_USAGE
151
152 Usage stuff
153
154         _END_MDOC_USAGE;
155 };
156
157 doc-section     = {
158   ds-type       = 'AUTHORS';
159   ds-format     = 'mdoc';
160   ds-text       = <<- _END_MDOC_AUTHORS
161 .An "Timothe Litt"
162         _END_MDOC_AUTHORS;
163 };