security/clamav: move to NAME_setup use

Fiddle with the freshclam script to use the rc system so that
setup.sh is invoked implicity.  Restart seems more reasonable
than an opportunistic start.

PR: https://github.com/opnsense/core/issues/5917
This commit is contained in:
Franco Fichtner
2022-09-06 09:10:22 +02:00
parent 27d89b8595
commit abf9ebdb11
5 changed files with 5 additions and 9 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
PLUGIN_NAME= clamav
PLUGIN_VERSION= 1.7
PLUGIN_REVISION= 1
PLUGIN_REVISION= 2
PLUGIN_COMMENT= Antivirus engine for detecting malicious threats
PLUGIN_DEPENDS= clamav
PLUGIN_MAINTAINER= m.muenz@gmail.com
@@ -37,7 +37,7 @@ elif pgrep -qF ${PIDFILE} 2> /dev/null; then
elif [ -z "${COMMAND}" ]; then
echo "missing"
else
daemon -f -p ${PIDFILE} freshclam --quiet
daemon -f -p ${PIDFILE} /usr/local/etc/rc.d/clamav-freshclam restart
echo "starting"
fi
@@ -1,6 +1,5 @@
[start]
command:
/usr/local/opnsense/scripts/OPNsense/ClamAV/setup.sh;
/usr/local/etc/rc.d/clamav-freshclam start;
/usr/local/etc/rc.d/clamav-clamd start
parameters:
@@ -17,7 +16,6 @@ message:stopping ClamAV
[restart]
command:
/usr/local/opnsense/scripts/OPNsense/ClamAV/setup.sh;
/usr/local/etc/rc.d/clamav-freshclam restart;
/usr/local/etc/rc.d/clamav-clamd restart
parameters:
@@ -31,9 +29,7 @@ type:script_output
message:request ClamAV status
[freshclam]
command:
/usr/local/opnsense/scripts/OPNsense/ClamAV/setup.sh;
/usr/local/opnsense/scripts/OPNsense/ClamAV/freshclam.sh
command:/usr/local/opnsense/scripts/OPNsense/ClamAV/freshclam.sh
parameters:%s
type:script_output
message:Check or install signatures
@@ -1,5 +1,5 @@
{% if helpers.exists('OPNsense.clamav.general.enabled') and OPNsense.clamav.general.enabled == '1' %}
clamav_clamd_var_script="/usr/local/opnsense/scripts/OPNsense/ClamAV/setup.sh"
clamav_clamd_setup="/usr/local/opnsense/scripts/OPNsense/ClamAV/setup.sh"
clamav_clamd_enable="YES"
{% else %}
clamav_clamd_enable="NO"
@@ -1,5 +1,5 @@
{% if helpers.exists('OPNsense.clamav.general.fc_enabled') and OPNsense.clamav.general.fc_enabled == '1' %}
clamav_freshclam_var_script="/usr/local/opnsense/scripts/OPNsense/ClamAV/setup.sh"
clamav_freshclam_setup="/usr/local/opnsense/scripts/OPNsense/ClamAV/setup.sh"
clamav_freshclam_enable="YES"
{% else %}
clamav_freshclam_enable="NO"