From: Harlan Stenn Date: Thu, 14 Dec 2017 04:30:41 +0000 (-0800) Subject: update-leap: updates from Paul McMath X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=863a2525279dccd964df7bbdf0f8d798baa5f8a7;p=thirdparty%2Fntp.git update-leap: updates from Paul McMath bk: 5a31fe71bFcs-rvEaDP2EV6MLG0EjA --- diff --git a/ChangeLog b/ChangeLog index 647764927..f5244beeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -57,6 +57,7 @@ * AES-128-CMAC support. BInglis, HStenn, JPerlinger. * sntp: tweak key file logging. HStenn. * sntp: pkt_output(): Improve debug output. HStenn. +* update-leap: updates from Paul McMath. --- (4.2.8p10) 2017/03/21 Released by Harlan Stenn diff --git a/scripts/update-leap/update-leap.in b/scripts/update-leap/update-leap.in index dd666046d..ff414cf7c 100755 --- a/scripts/update-leap/update-leap.in +++ b/scripts/update-leap/update-leap.in @@ -75,7 +75,7 @@ my %SSL_ATTRS = ( our(%opt); -GetOptions(\%opt, +GetOptions(\%opt, 'C=s', 'D=s', 'e:60', @@ -125,6 +125,14 @@ else { $TOTERM = 1; } +if (defined $opt{q} && defined $opt{v}) { + log_fatal(LOG_ERR, '-q and -v options mutually exclusive'); +} + +if (defined $opt{L} && defined $opt{f}) { + log_fatal(LOG_ERR, '-L and -f options mutually exclusive'); +} + $SIG{INT} = \&signal_catcher; $SIG{TERM} = \&signal_catcher; $SIG{QUIT} = \&signal_catcher; @@ -144,14 +152,6 @@ if (defined $opt{h}) { exit 0; } -if ($QUIET && $DEBUG) { - log_fatal(LOG_ERR, '-q and -d options mutually exclusive'); -} - -if ($LEAPFILE && $NTPCONF) { - log_fatal(LOG_ERR, '-L and -f options mutually exclusive'); -} - # Parse ntp.conf for path to leapfile if not set by user if (! $LEAPFILE) { @@ -201,6 +201,7 @@ if ( !-e $LEAPFILE || $FORCE || ! verifySHA($LEAPFILE) || } # Failure + unlink $TMP_FILE; logger(LOG_INFO, "Download failed. Waiting $INTERVAL minutes before retrying..."); sleep $INTERVAL * 60 ; } @@ -273,9 +274,9 @@ sub logger { # unknown state). # # HTTP::Tiny doesn't export a method to explicitly close a connected -# socket, therefore, we instantiate the lexically scoped object in a -# function; when the function returns, the http object goes out of -# scope and is destroyed, closing the socket. +# socket, therefore, we instantiate the lexically scoped $http object in +# a function; when the function returns, the object goes out of scope +# and is destroyed, closing the socket. sub retrieve_file { my $fh = shift;