update-leap.in (302408) | update-leap.in (309007) |
---|---|
1#! @PATH_PERL@ -w 2 3# Copyright (C) 2015 Network Time Foundation 4# Author: Harlan Stenn 5 6# Original shell version: 7# Copyright (C) 2014 Timothe Litt litt at acm dot org 8 --- 20 unchanged lines hidden (view full) --- 29 30my $CRONJOB = $ENV{'CRONJOB'}; 31$CRONJOB = "" unless defined($CRONJOB); 32my $LOGGER; 33my $QUIET = ""; 34my $VERBOSE = ""; 35 36# Where to get the file | 1#! @PATH_PERL@ -w 2 3# Copyright (C) 2015 Network Time Foundation 4# Author: Harlan Stenn 5 6# Original shell version: 7# Copyright (C) 2014 Timothe Litt litt at acm dot org 8 --- 20 unchanged lines hidden (view full) --- 29 30my $CRONJOB = $ENV{'CRONJOB'}; 31$CRONJOB = "" unless defined($CRONJOB); 32my $LOGGER; 33my $QUIET = ""; 34my $VERBOSE = ""; 35 36# Where to get the file |
37my $LEAPSRC="ftp://time.nist.gov/pub/leap-seconds.list"; | 37# Choices: 38# https://www.ietf.org/timezones/data/leap-seconds.list 39# ftp://time.nist.gov/pub/leap-seconds.list 40my $LEAPSRC="https://www.ietf.org/timezones/data/leap-seconds.list"; |
38my $LEAPFILE; 39 40# How many times to try to download new file 41my $MAXTRIES=6; 42my $INTERVAL=10; 43 44# Where to find ntp config file 45my $NTPCONF="/etc/ntp.conf"; --- 249 unchanged lines hidden (view full) --- 295 296-r $NTPCONF || die "Missing ntp configuration: $NTPCONF\n"; 297 298# Parse ntp.conf for leapfile directive 299 300open(LF, $NTPCONF) || die "Can't open <$NTPCONF>: $!\n"; 301while (<LF>) { 302 chomp; | 41my $LEAPFILE; 42 43# How many times to try to download new file 44my $MAXTRIES=6; 45my $INTERVAL=10; 46 47# Where to find ntp config file 48my $NTPCONF="/etc/ntp.conf"; --- 249 unchanged lines hidden (view full) --- 298 299-r $NTPCONF || die "Missing ntp configuration: $NTPCONF\n"; 300 301# Parse ntp.conf for leapfile directive 302 303open(LF, $NTPCONF) || die "Can't open <$NTPCONF>: $!\n"; 304while (<LF>) { 305 chomp; |
303 if (/^ *leapfile\s+(\S+)/) { | 306 if (/^ *leapfile\s+"(\S+)"/) { |
304 $LEAPFILE = $1; 305 } 306} 307close LF; 308 309-s $LEAPFILE || warn "$NTPCONF specifies $LEAPFILE as a leapfile, which is empty.\n"; 310 311# Allow placing the file someplace else - testing --- 113 unchanged lines hidden --- | 307 $LEAPFILE = $1; 308 } 309} 310close LF; 311 312-s $LEAPFILE || warn "$NTPCONF specifies $LEAPFILE as a leapfile, which is empty.\n"; 313 314# Allow placing the file someplace else - testing --- 113 unchanged lines hidden --- |