File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed
Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff 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 ' ) {
You can’t perform that action at this time.
0 commit comments