[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-5-g96944a3
Stephen Gran
steve at lobefin.net
Thu Mar 26 16:15:09 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 96944a38cd71db3bdb57b6d16f92e1d686519e34
Author: Stephen Gran <steve at lobefin.net>
Date: Thu Mar 26 12:14:16 2009 -0400
Try to get some default values of clamd.conf if we don't have a milter
config yet.
Signed-off-by: Stephen Gran <steve at lobefin.net>
diff --git a/debian/clamav-milter.config.in b/debian/clamav-milter.config.in
index 4f657ee..62f17ef 100644
--- a/debian/clamav-milter.config.in
+++ b/debian/clamav-milter.config.in
@@ -23,8 +23,18 @@ if [ -e "/etc/default/clamav-milter" ] ; then
fi
CLAMAVMILTERCONF='/etc/clamav/clamav-milter.conf'
+CLAMDCONF='/etc/clamav/clamd.conf'
-slurp_config "$CLAMAVMILTERCONF"
+HAVEMILTERCONF=true
+
+if ! [ -e "$CLAMAVMILTERCONF" ]; then
+ if [ -e "$CLAMDCONF" ]; then
+ slurp_config "$CLAMDCONF"
+ fi
+ HAVEMILTERCONF=false
+else
+ slurp_config "$CLAMAVMILTERCONF"
+fi
# Store conf file values as debconf answers - make sure user changes made
# outside of debconf are preserved
@@ -52,7 +62,7 @@ fi
if [ -n "$Chroot" ]; then
db_set clamav-milter/Chroot "$Chroot" || true
fi
-if [ -n "$PidFile" ]; then
+if [ "$HAVEMILTERCONF" = 'true' ] && [ -n "$PidFile" ]; then
db_set clamav-milter/PidFile "$PidFile" || true
fi
if [ -n "$TemporaryDirectory" ]; then
@@ -60,6 +70,18 @@ if [ -n "$TemporaryDirectory" ]; then
fi
if [ -n "$ClamdSocket" ]; then
db_set clamav-milter/ClamdSocket "$ClamdSocket" || true
+else
+ if [ "$HAVEMILTERCONF" = 'false' ]; then
+ if [ -n "$LocalSocket" ]; then
+ db_set clamav-milter/ClamdSocket "unix:${LocalSocket}" || true
+ elif [ -n "$TCPSocket" ]; then
+ if [ -n "$TCPAddr" ] ; then
+ db_set clamav-milter/ClamdSocket "tcp:${TCPAddr}:${TCPSocket}" || true
+ else
+ db_set clamav-milter/ClamdSocket "tcp:127.0.0.1:${TCPSocket}" || true
+ fi
+ fi
+ fi
fi
if [ -n "$LocalNet" ]; then
db_set clamav-milter/LocalNet "$LocalNet" || true
@@ -82,7 +104,7 @@ fi
if [ "$AddHeader" = "true" ]; then
db_set clamav-milter/AddHeader true || true
fi
-if [ -n "$LogFile" ]; then
+if [ "$HAVEMILTERCONF" = 'true' ] && [ -n "$LogFile" ]; then
db_set clamav-milter/LogFile "$LogFile" || true
fi
if [ "$LogFileUnlock" = "true" ]; then
--
Debian repository for ClamAV
More information about the Pkg-clamav-commits
mailing list