Fix: ClamAV isInstalled() via file_exists statt Hardcode true

Prüft /usr/sbin/clamd und systemd unit-Dateien ohne exec().
Zeigt Install-Button wenn ClamAV nicht installiert ist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main v1.1.339
boban 2026-04-26 21:17:24 +02:00
parent 5f627dcb0e
commit fa65bc1c2e
1 changed files with 8 additions and 1 deletions

View File

@ -52,7 +52,7 @@ class ClamavManager extends Component
$this->lastSuccess = '';
$this->running = $this->serviceActive();
$this->enabled = $this->serviceEnabled();
$this->installed = true;
$this->installed = $this->isInstalled();
$this->ramMb = $this->running ? $this->readRamMb() : null;
[$this->dbDate, $this->dbVersion] = $this->readDbInfo();
}
@ -128,6 +128,13 @@ class ClamavManager extends Component
return [$rc === 0, $msg];
}
private function isInstalled(): bool
{
return file_exists('/usr/sbin/clamd')
|| file_exists('/lib/systemd/system/clamav-daemon.service')
|| file_exists('/usr/lib/systemd/system/clamav-daemon.service');
}
private function serviceActive(): bool
{
$exit = null;