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