Skip to content

Commit

Permalink
Merge pull request #119 from untangle/phish-blocker
Browse files Browse the repository at this point in the history
phish blocker fresh install conf issue
  • Loading branch information
singhrohit23 authored Jan 31, 2025
2 parents 87db53f + d9a8c58 commit d5f0270
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions untangle-clamav-config/debian/untangle-clamav-config.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,36 @@ unsetOption() {
}

#for upgrades from >=17.3 clamav version is upgraded
if dpkg --compare-versions "$oldVersion" ge 17.3~ ; then
#Socket communication done by daemon-socket service, comment configuration in /etc/clamav/clamd.conf
unsetOption TCPAddr
unsetOption TCPSocket
unsetOption LocalSocket
mkdir -p $CLAMAV_SOCKET_DIR
unsetOption TCPAddr
unsetOption TCPSocket


unsetOption LocalSocket
mkdir -p $CLAMAV_SOCKET_DIR

#Socket communication done by daemon-socket service, Adding configuration file for the same
if [[ ! -f $CLAMAV_SOCKET_DIR/override.conf ]]; then
if [[ ! -f $CLAMAV_SOCKET_DIR/override.conf ]]; then
touch "$CLAMAV_SOCKET_DIR/override.conf"
cat <<EOL >> "$CLAMAV_SOCKET_DIR/override.conf"
[Socket]
ListenStream=
ListenStream=/run/clamav/clamd.ctl
ListenStream=127.0.0.1:3310
EOL
fi

#adding new systemd override file
systemctl daemon-reload
fi

#adding new systemd override file
systemctl daemon-reload


# options we need
#setOption TCPAddr 127.0.0.1
#setOption TCPSocket 3310
setOption MaxFileSize 100M
setOption StreamMaxLength 100M

# disable clamav at startup (apps start as necessary)
deb-systemd-helper disable clamav-daemon.service

SERVICE_NAME="clamav-freshclam"
IS_RUNNING="active (running)"
Expand All @@ -72,11 +72,15 @@ IS_RUNNING="active (running)"
if systemctl is-active --quiet $SERVICE_NAME && \
systemctl status $SERVICE_NAME | grep -q "$IS_RUNNING"; then
systemctl stop clamav-freshclam.service
systemctl stop clamav-daemon.service
systemctl stop clamav-daemon.socket
/usr/bin/freshclam --foreground=true
systemctl start clamav-freshclam.service
systemctl start clamav-daemon.service
else
/usr/bin/freshclam --foreground=true
deb-systemd-helper disable clamav-freshclam.service
deb-systemd-helper disable clamav-daemon.service
fi


Expand Down

0 comments on commit d5f0270

Please sign in to comment.