Commits

Zhang Huangbin committed 6a370ed

Code cleanup.

  • Participants
  • Parent commits 2767707

Comments (0)

Files changed (3)

iRedMail/conf/clamav

 export CLAMAV_FRESHCLAMD_RC_SCRIPT_NAME='freshclamd'
 
 export CLAMD_CONF='/etc/clamd.conf'
+export CLAMD_LOGFILE='/var/log/clamav/clamd.log'
+export CLAMD_LOCAL_SOCKET='/tmp/clamd.socket'   # Used to override default setting.
+
 export FRESHCLAM_CONF='/etc/freshclam.conf'
-
-export CLAMD_LOGFILE='/var/log/clamav/clamd.log'
 export FRESHCLAM_LOGFILE='/var/log/clamav/freshclam.log'
+export FRESHCLAM_PID_FILE='/var/run/clamav/freshclam.pid'
 
 # Clamav.
 if [ X"${DISTRO}" == X"RHEL" ]; then
     export CLAMAV_USER='_clamav'
     export CLAMAV_GROUP='_clamav'
     export CLAMAV_FRESHCLAMD_RC_SCRIPT_NAME='freshclam'
+
+    export FRESHCLAM_PID_FILE='/var/run/freshclam.pid'
 fi
 
 # Clamd.
 # Clamd local socket.
 if [ X"${DISTRO}" == X"GENTOO" \
     -o X"${DISTRO}" == X"FREEBSD" \
-    -o X"${DISTRO}" == X'OPENBSD' \
     ]; then
     export CLAMD_LOCAL_SOCKET='/var/run/clamav/clamd.sock'
-else
-    export CLAMD_LOCAL_SOCKET='/tmp/clamd.socket'   # Used to override default setting.
 fi
-
-# Freshclam.
-export FRESHCLAM_PID_FILE='/var/run/clamav/freshclam.pid'   # Used to override default setting.

iRedMail/conf/core

                     if [ ! -e ${TIP_FILE} ]; then
                         cat > ${TIP_FILE} <<EOF
 ${CONF_MSG}
-If you consider here should be put some more infomation, please contact us:
-    - http://www.iredmail.org/contact.html
-
 EOF
                     else
                         :

iRedMail/functions/clamav.sh

     perl -pi -e 's/^#(LogFile ).*/${1}$ENV{CLAMD_LOGFILE}/' ${CLAMD_CONF}
 
     # Set CLAMD_LOCAL_SOCKET
-    # - for clamav = 0.9.6
+    perl -pi -e 's/^(LocalSocket ).*/${1}$ENV{CLAMD_LOCAL_SOCKET}/' ${CLAMD_CONF}
     perl -pi -e 's/^#(LocalSocket ).*/${1}$ENV{CLAMD_LOCAL_SOCKET}/' ${CLAMD_CONF}
 
     ECHO_DEBUG "Configure freshclam: ${FRESHCLAM_CONF}."
-    perl -pi -e 's-^#(PidFile )(.*)-${1}$ENV{FRESHCLAM_PID_FILE}-' ${FRESHCLAM_CONF}
     perl -pi -e 's#^(UpdateLogFile ).*#${1}$ENV{FRESHCLAM_LOGFILE}#' ${CLAMD_CONF}
+    perl -pi -e 's/^#(UpdateLogFile ).*/${1}$ENV{FRESHCLAM_LOGFILE}/' ${CLAMD_CONF}
 
     # Official database only
     perl -pi -e 's/^#(OfficialDatabaseOnly ).*/${1} yes/' ${CLAMD_CONF}
         - ${FRESHCLAM_CONF}
         - /etc/logrotate.d/clamav
     * RC scripts:
-        - RHEL/CentOS/openSUSE:
-            + ${DIR_RC_SCRIPTS}/clamd 
-            + ${DIR_RC_SCRIPTS}/freshclam
-        - Debian & Ubuntu:
-            + ${DIR_RC_SCRIPTS}/clamav-daemon
-            + ${DIR_RC_SCRIPTS}/clamav-freshclam
-        - FreeBSD:
-            + ${DIR_RC_SCRIPTS}/clamav-clamd
-            + ${DIR_RC_SCRIPTS}/clamav-freshclam
+            + ${DIR_RC_SCRIPTS}/${CLAMAV_CLAMD_RC_SCRIPT_NAME}
+            + ${DIR_RC_SCRIPTS}/${CLAMAV_FRESHCLAMD_RC_SCRIPT_NAME}
     * Log files:
         - ${CLAMD_LOGFILE}
         - ${FRESHCLAM_LOGFILE}