]> git.proxmox.com Git - pve-installer.git/blob - checktime
run env: use default error message if country detection failed with empty string
[pve-installer.git] / checktime
1 #!/usr/bin/perl -w
2
3 use strict;
4 use File::stat;
5
6 sub testtime {
7
8 my $st = stat ("/usr/bin/checktime") || stat ("./checktime");
9
10 my $ctime = time();
11
12 if ($ctime < $st->atime) {
13 warn "detected wrong system time\n";
14 my $tstr = localtime $st->atime;
15 # correct system time to avoid errors, i.e gpg fails
16 system ("date -s '$tstr'");
17 }
18 }
19
20 testtime();
21
22 exit (0);