]> git.proxmox.com Git - pve-installer.git/blame - checktime
fix file permissions in html-pmg
[pve-installer.git] / checktime
CommitLineData
89a12446
DM
1#!/usr/bin/perl -w
2
3use strict;
4use File::stat;
5
6sub 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
20testtime();
21
22exit (0);