mailwolt/scripts/mailwolt-clamav

32 lines
816 B
Bash
Executable File

#!/usr/bin/env bash
# Wrapper für ClamAV-Verwaltung via MailWolt UI (läuft als root via sudo)
set -euo pipefail
CMD="${1:-status}"
case "$CMD" in
enable)
systemctl enable clamav-daemon
systemctl start clamav-daemon
echo "ClamAV aktiviert und gestartet."
;;
disable)
systemctl stop clamav-daemon || true
systemctl disable clamav-daemon
echo "ClamAV gestoppt und deaktiviert."
;;
freshclam)
systemctl stop clamav-freshclam 2>/dev/null || true
freshclam --quiet
systemctl start clamav-freshclam 2>/dev/null || true
echo "Signaturen aktualisiert."
;;
status)
systemctl is-active clamav-daemon 2>/dev/null && echo "active" || echo "inactive"
;;
*)
echo "Usage: mailwolt-clamav {enable|disable|freshclam|status}" >&2
exit 1
;;
esac