Skip to content

Commit

Permalink
scope fix
Browse files Browse the repository at this point in the history
  • Loading branch information
swelljoe committed May 27, 2017
1 parent 03c6caa commit 888850b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Virtualmin/Config/Plugin/NTP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ sub new {
return $self;
}

my $clocksource;
# actions method performs whatever configuration is needed for this
# plugin. XXX Needs to make a backup so changes can be reverted.
sub actions {
Expand All @@ -25,7 +26,8 @@ sub actions {
my $clockfile = "/sys/devices/system/clocksource/clocksource0/current_clocksource";
if (-e $clockfile) {
open(my $CLOCK, "<", $clockfile) or die "Couldn't open $clockfile: $!";
my $clocksource = do { local $/ = <$clocksource> };
$clocksource = do { local $/ = <$clockfile> };
close $clockfile;
if ($clocksource eq "kvm-clock") {
$log->info("System clock source is kvm-clock, skipping NTP");
$self->done(1);
Expand Down

0 comments on commit 888850b

Please sign in to comment.