]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
update-leap: updates from Paul McMath
authorHarlan Stenn <stenn@ntp.org>
Thu, 14 Dec 2017 04:30:41 +0000 (20:30 -0800)
committerHarlan Stenn <stenn@ntp.org>
Thu, 14 Dec 2017 04:30:41 +0000 (20:30 -0800)
bk: 5a31fe71bFcs-rvEaDP2EV6MLG0EjA

ChangeLog
scripts/update-leap/update-leap.in

index 6477649271c10a56437858f1964e768337db74e7..f5244beeb9188ce70695754228878b219ca1db28 100644 (file)
--- 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 <stenn@ntp.org>
index dd666046d6295e51821c4bc40243ebd9a90d5d1a..ff414cf7ced1bb5c75ba55b77ad9549507efea1b 100755 (executable)
@@ -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;