- pametniji restart Postfixa u slucaju promjena u konfiguraciji
authorDinko Korunic <kreator@carnet.hr>
Mon, 14 Apr 2008 20:48:00 +0000 (22:48 +0200)
committerDinko Korunic <kreator@carnet.hr>
Mon, 14 Apr 2008 20:48:00 +0000 (22:48 +0200)
Signed-off-by: Dinko Korunic <kreator@carnet.hr>

src/postfix.sh

index 1d74552..7aa3961 100755 (executable)
@@ -5,10 +5,14 @@ update_postfix() {
           dpkg --compare-versions "$2" lt $MASTTMPLVERSION ); then
     noisy_backup /etc/postfix/master.cf
     cp-update $PKG /etc/postfix/master.cf < $MASTTMPL
+    restart_mta=1
   fi
 
   # main.cf
-  postconf -e content_filter="smtp-amavis:[127.0.0.1]:10024"
-  
-  restart_mta=1
+  if [ ! -f /etc/postfix/main.cf ] || \
+      ! grep -q "smtp-amavis:[127.0.0.1]:10024" \
+        /etc/postfix/main.cf; then
+    postconf -e content_filter="smtp-amavis:[127.0.0.1]:10024"
+    restart_mta=1
+  fi
 }