Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Aug 24, 2017
1 parent 6d8ce15 commit da9b1f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions awstats.pl
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
my $dname = shift(@ARGV);

if ($debug) {
&generate_report($ARGV[0], *STDERR, 0);
&generate_report($dname, *STDERR, 0);
}
else {
open(my $NULL, ">", "/dev/null");
&generate_report($ARGV[0], $NULL, 0);
&generate_report($dname, $NULL, 0);
close($NULL);
}
if ($output) {
Expand Down
6 changes: 4 additions & 2 deletions virtualmin-awstats-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ sub find_cron_job
my ($dom) = @_;
my @jobs = &cron::list_cron_jobs();
my ($job) = grep { $_->{'user'} eq 'root' &&
$_->{'command'} =~ /^\Q$cron_cmd\E\s+(--output\s+\S+\s+)?\Q$dom\E$/ } @jobs;
$_->{'command'} =~ /^\Q$cron_cmd\E\s+(--output\s+\S+\s+)?\Q$dom\E$/ } @jobs;
return $job;
}

Expand All @@ -224,9 +224,11 @@ sub find_cron_job
# internal list
sub get_run_user
{
my ($dname) = @_;
$dname ||= "";
my %runas;
&read_file_cached($run_as_file, \%runas);
return $runas{$_[0]} || "root";
return $runas{$dname} || "root";
}

# save_run_user(domain, user)
Expand Down

0 comments on commit da9b1f0

Please sign in to comment.