- install changelogs..
[amavisd-cn.git] / src / functions.sh
old mode 100644 (file)
new mode 100755 (executable)
index 6363ac9..8a41591
@@ -138,3 +138,23 @@ conf_from_template() {
   restart_daemon=1
   changed_config=1
 }
+
+# Place configuration tweaks done on upgrades into this function
+update_conf() {
+  # placeholder.
+  # remember to set changed_config=1 and restart_daemon=1 if necessary
+  #:
+  if dpkg --compare-versions "$2" lt "$MASTTMPLVERSION"; then
+    conf_from_template
+  fi
+}
+
+add_redirection() {
+    until [ -z "$1" ]
+    do
+        if [ -e "$1" ] && egrep -q 'amavisd-new-cronjob (sa-sync|sa-clean)$' "$1"; then
+sed -i -e 's:\(^.*amavisd-new-cronjob \(sa-sync\|sa-clean\)$\):\1 1>/dev/null 2>\&1:g' "$1"
+        fi
+        shift
+    done
+}