diff --git a/app/Jobs/ClamavEnable.php b/app/Jobs/ClamavEnable.php new file mode 100644 index 0000000..d380d68 --- /dev/null +++ b/app/Jobs/ClamavEnable.php @@ -0,0 +1,25 @@ +&1', $out, $rc); + \Log::info('ClamavEnable job', ['rc' => $rc, 'out' => $out]); + if ($rc !== 0) { + throw new \RuntimeException('mailwolt-clamav enable failed (rc=' . $rc . '): ' . implode(' ', $out)); + } + } +} diff --git a/app/Livewire/Ui/Security/ClamavManager.php b/app/Livewire/Ui/Security/ClamavManager.php index 834ecb4..0197880 100644 --- a/app/Livewire/Ui/Security/ClamavManager.php +++ b/app/Livewire/Ui/Security/ClamavManager.php @@ -2,6 +2,7 @@ namespace App\Livewire\Ui\Security; +use App\Jobs\ClamavEnable; use Livewire\Attributes\Layout; use Livewire\Attributes\Title; use Livewire\Component; @@ -55,7 +56,7 @@ class ClamavManager extends Component { $this->lastError = ''; $this->lastSuccess = ''; - @shell_exec('nohup sudo -n /usr/local/sbin/mailwolt-clamav enable /tmp/mw-clamav-start.log 2>&1 &'); + ClamavEnable::dispatch(); $this->enabled = true; $this->lastSuccess = 'ClamAV wird gestartet… Dies kann bis zu 60 Sekunden dauern. Klicken Sie danach auf „Aktualisieren".'; }