izbacen stari /etc/cron.daily/amavisd-new
[amavisd-cn.git] / debian / init
index 62f701f..3f1b26a 100755 (executable)
@@ -1,5 +1,21 @@
 #!/bin/sh
 
+# amavisd-cn    /etc/init.d/ initscript wrapper for CARNetized amavisd-new
+#
+# Start and stop Amavis, ClamAV and Postfix/Sendmail
+
+### BEGIN INIT INFO
+# Provides:          amavisd-cn
+# Required-Start:    $local_fs $remote_fs $syslog $named $network $time
+# Required-Stop:     $local_fs $remote_fs $syslog $named $network
+# Should-Start:
+# Should-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: start and stop Amavis, ClamAV and Postfix/Sendmail
+# Description:       wrapper for starting/stopping MTA and related services
+### END INIT INFO
+
 set -e
 
 # options for daemons:
@@ -108,18 +124,30 @@ esac
 mta=postfix
 
 case "$arg" in
-  start|stop|restart|reload|force-reload)
+  start|stop|restart|reload|force-reload|debug)
        /etc/init.d/amavis.amavisd-new "$arg"
        ;;
 
   istart)
        start clamd
        start amavis
-       /etc/init.d/$mta start
+    if [ -x "/etc/init.d/$mta" ]; then
+            if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+                    invoke-rc.d $mta start
+            else
+                    /etc/init.d/$mta start
+            fi
+    fi
        ;;
 
   istop)
-       /etc/init.d/$mta stop
+    if [ -x "/etc/init.d/$mta" ]; then
+            if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+                    invoke-rc.d $mta stop
+            else
+                    /etc/init.d/$mta stop
+            fi
+    fi
        stop amavis
        stop clamd
        ;;