mirror of
https://git.proxmox.com/git/pve-installer
synced 2025-04-28 10:32:12 +00:00
23 lines
379 B
Perl
Executable File
23 lines
379 B
Perl
Executable File
#!/usr/bin/perl -w
|
|
|
|
use strict;
|
|
use File::stat;
|
|
|
|
sub testtime {
|
|
|
|
my $st = stat ("/usr/bin/checktime") || stat ("./checktime");
|
|
|
|
my $ctime = time();
|
|
|
|
if ($ctime < $st->atime) {
|
|
warn "detected wrong system time\n";
|
|
my $tstr = localtime $st->atime;
|
|
# correct system time to avoid errors, i.e gpg fails
|
|
system ("date -s '$tstr'");
|
|
}
|
|
}
|
|
|
|
testtime();
|
|
|
|
exit (0);
|