]> git.proxmox.com Git - pve-installer.git/blob - checktime
bump version to 8.1.5
[pve-installer.git] / checktime
1 #!/usr/bin/perl -w
2
3 use strict;
4 use warnings;
5
6 use File::stat;
7 use POSIX qw(strftime);
8
9 sub testtime {
10 my $st = stat("/usr/bin/checktime") || stat("./checktime");
11
12 my $ctime = time();
13
14 if ($ctime < $st->atime) {
15 my $system_time_str = strftime "%F %T", localtime $ctime;
16 my $pkg_time_str = strftime "%F %T", localtime $st->atime;
17 warn "detected wrong system time $system_time_str, older than installer ($pkg_time_str)\n";
18 my $tstr = localtime $st->atime;
19 # correct system time to avoid errors, i.e gpg fails
20 system ("date -s '$tstr'");
21 }
22 }
23
24 testtime();
25
26 exit (0);