mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
security/clamav: fix symlink permission mismatch, cleanups; closes #569
FreeBSD sets 0755 as permission so let's just follow to avoid potential mismatches in the future.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
PLUGIN_NAME= clamav
|
||||
PLUGIN_VERSION= 1.5
|
||||
PLUGIN_REVISION= 1
|
||||
PLUGIN_COMMENT= Antivirus engine for detecting malicious threats
|
||||
PLUGIN_DEPENDS= clamav
|
||||
PLUGIN_MAINTAINER= m.muenz@gmail.com
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
mkdir -p /var/run/clamav
|
||||
chown -R clamav:clamav /var/run/clamav
|
||||
chmod 750 /var/run/clamav
|
||||
USER=clamav
|
||||
GROUP=clamav
|
||||
PERMS=0755
|
||||
DIRS="
|
||||
/var/db/clamav
|
||||
/var/run/clamav
|
||||
/var/log/clamav
|
||||
"
|
||||
|
||||
mkdir -p /var/db/clamav
|
||||
chown -R clamav:clamav /var/db/clamav
|
||||
chmod 750 /var/db/clamav
|
||||
for DIR in ${DIRS}; do
|
||||
if [ -L ${DIR} ]; then
|
||||
DIRS="${DIRS} $(realpath ${DIR})"
|
||||
fi
|
||||
done
|
||||
|
||||
mkdir -p /var/log/clamav
|
||||
chown -R clamav:clamav /var/log/clamav
|
||||
chmod 750 /var/log/clamav
|
||||
for DIR in ${DIRS}; do
|
||||
mkdir -p ${DIR}
|
||||
chown -R ${USER}:${GROUP} ${DIR}
|
||||
chmod ${PERMS} ${DIR}
|
||||
done
|
||||
|
||||
@@ -1,29 +1,39 @@
|
||||
[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
|
||||
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:
|
||||
type:script
|
||||
message:starting ClamAV
|
||||
|
||||
[stop]
|
||||
command:/usr/local/etc/rc.d/clamav-freshclam stop;/usr/local/etc/rc.d/clamav-clamd stop; exit 0
|
||||
command:
|
||||
/usr/local/etc/rc.d/clamav-freshclam stop;
|
||||
/usr/local/etc/rc.d/clamav-clamd stop
|
||||
parameters:
|
||||
type:script
|
||||
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
|
||||
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:
|
||||
type:script
|
||||
message:restarting ClamAV
|
||||
|
||||
[status]
|
||||
command:/usr/local/etc/rc.d/clamav-freshclam status;/usr/local/etc/rc.d/clamav-clamd status;exit 0
|
||||
command: /usr/local/etc/rc.d/clamav-clamd status; exit 0
|
||||
parameters:
|
||||
type:script_output
|
||||
message:request ClamAV status
|
||||
|
||||
[freshclam]
|
||||
command:/usr/local/opnsense/scripts/OPNsense/ClamAV/freshclam.sh
|
||||
command:
|
||||
/usr/local/opnsense/scripts/OPNsense/ClamAV/setup.sh;
|
||||
/usr/local/opnsense/scripts/OPNsense/ClamAV/freshclam.sh
|
||||
parameters:%s
|
||||
type:script_output
|
||||
message:Check or install signatures
|
||||
|
||||
Reference in New Issue
Block a user