]> git.proxmox.com Git - pve-installer.git/blobdiff - checktime
serial install: fix console parameter parsing
[pve-installer.git] / checktime
index fc609c657b7991f73e3743abce6ac7e32a576dfb..723edd67a6885e6c1af05985ce65c574ef78714d 100755 (executable)
--- a/checktime
+++ b/checktime
@@ -1,20 +1,24 @@
 #!/usr/bin/perl -w
 
 use strict;
+use warnings;
+
 use File::stat;
+use POSIX qw(strftime);
 
 sub testtime {
-
-    my $st = stat ("/usr/bin/checktime") || stat ("./checktime");
+    my $st = stat("/usr/bin/checktime") || stat("./checktime");
 
     my $ctime = time();
 
     if ($ctime < $st->atime) {
-       warn "detected wrong system time\n";
+       my $system_time_str = strftime "%F %T", localtime $ctime;
+       my $pkg_time_str = strftime "%F %T", localtime $st->atime;
+       warn "detected wrong system time $system_time_str, older than installer ($pkg_time_str)\n";
        my $tstr = localtime $st->atime;
        # correct system time to avoid errors, i.e gpg fails
        system ("date -s '$tstr'"); 
-    }   
+    }
 }
 
 testtime();