summaryrefslogtreecommitdiffstats
path: root/amavisd-new/amavisd
diff options
context:
space:
mode:
Diffstat (limited to 'amavisd-new/amavisd')
-rw-r--r--amavisd-new/amavisd77
1 files changed, 77 insertions, 0 deletions
diff --git a/amavisd-new/amavisd b/amavisd-new/amavisd
new file mode 100644
index 0000000..3061535
--- /dev/null
+++ b/amavisd-new/amavisd
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+DAEMON_CONF="/etc/amavisd/amavisd.conf"
+
+PID=`pidof -o %PPID amavisd`
+
+case "$1" in
+
+ start)
+
+ stat_busy "Starting amavisd"
+
+ [ -z "$PID" ] && /usr/sbin/amavisd -c ${DAEMON_CONF} &> /dev/null
+
+ if [ $? -gt 0 ]; then
+
+ stat_fail
+
+ else
+
+ add_daemon amavisd
+
+ stat_done
+
+ fi
+
+ ;;
+
+ stop)
+
+ stat_busy "Stopping amavisd"
+
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+
+ if [ $? -gt 0 ]; then
+
+ stat_fail
+
+ else
+
+ rm_daemon amavisd
+ stat_done
+
+ fi
+
+ ;;
+
+ restart)
+
+ $0 stop
+
+ sleep 3
+
+ $0 start
+
+ ;;
+
+ reload)
+
+ stat_busy "Reloading amavisd"
+
+ /usr/sbin/amavisd -c ${DAEMON_CONF} reload
+
+ stat_done
+
+ ;;
+
+ *)
+ echo "usage: $0 {start|stop|restart|reload}"
+ ;;
+
+esac
+
+exit 0