Skip to content

Commit 5ca9a0c

Browse files
author
Till Brehm
committed
Merge branch '5753-show-letsencrypt-log-even-when-acme-sh-is-installed' into 'develop'
Resolve "Show LetsEncrypt.log even when acme.sh is installed" Closes #5753 See merge request ispconfig/ispconfig3!1195
2 parents 8b32612 + 131ff32 commit 5ca9a0c

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

server/lib/classes/monitor_tools.inc.php

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,13 +561,30 @@ public function _getLogData($log) {
561561
}
562562
break;
563563
case 'log_letsencrypt':
564+
$check_files = [];
565+
if(file_exists($conf['ispconfig_log_dir'].'/acme.log')) {
566+
$check_files[] = $conf['ispconfig_log_dir'].'/acme.log';
567+
}
564568
if(file_exists('/root/.acme.sh/acme.sh') && file_exists('/root/.acme.sh/acme.sh.log')) {
565-
$logfile = '/root/.acme.sh/acme.sh.log';
566-
} elseif(file_exists('/usr/local/ispconfig/server/scripts/acme.sh') && file_exists('/usr/local/ispconfig/server/scripts/acme.sh.log')) {
567-
$logfile = '/usr/local/ispconfig/server/scripts/acme.sh.log';
568-
} else {
569-
$logfile = '/var/log/letsencrypt/letsencrypt.log';
569+
$check_files[] = '/root/.acme.sh/acme.sh.log';
570+
}
571+
if(file_exists('/usr/local/ispconfig/server/scripts/acme.sh') && file_exists('/usr/local/ispconfig/server/scripts/acme.sh.log')) {
572+
$check_files[] = '/usr/local/ispconfig/server/scripts/acme.sh.log';
573+
}
574+
if(file_exists('/var/log/letsencrypt/letsencrypt.log')) {
575+
$check_files = '/var/log/letsencrypt/letsencrypt.log';
576+
}
577+
$logfile = '';
578+
$newest = 0;
579+
580+
foreach($check_files as $file) {
581+
$mtime = filemtime($file);
582+
if($mtime > $newest) {
583+
$newest = $mtime;
584+
$logfile = $file;
585+
}
570586
}
587+
unset($check_files);
571588
break;
572589
case 'log_freshclam':
573590
if ($dist == 'debian') {

0 commit comments

Comments
 (0)