summaryrefslogtreecommitdiff
path: root/network/amavisd-new/rc.amavisd-new
diff options
context:
space:
mode:
authorNishant Limbachia <nishant@mnspace.net>2011-07-10 10:21:20 -0300
committerNiels Horn <niels.horn@slackbuilds.org>2011-07-14 19:51:00 -0300
commit35a5368e8451ee8228a10c96b5633373affd1015 (patch)
tree938d3d8fb11891c3e606aa00f03d68d31dab25f2 /network/amavisd-new/rc.amavisd-new
parent9a4660332e3a555e52672fce457cb9ec1afc2d40 (diff)
downloadslackbuilds-35a5368e8451ee8228a10c96b5633373affd1015.tar.gz
network/amavisd-new: Updated for version 2.6.6.
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'network/amavisd-new/rc.amavisd-new')
-rw-r--r--network/amavisd-new/rc.amavisd-new62
1 files changed, 62 insertions, 0 deletions
diff --git a/network/amavisd-new/rc.amavisd-new b/network/amavisd-new/rc.amavisd-new
new file mode 100644
index 0000000000..9d0de3dd68
--- /dev/null
+++ b/network/amavisd-new/rc.amavisd-new
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# Copyright (c) 2008-2011, Nishant Limbachia, Hoffman Estates, IL, USA
+# <nishant _AT_ mnspace _DOT_ net>
+# /etc/rc.d/rc.amavisd
+# start|stop|restart|status for amavisd-new
+# For automatic start at boot up, call this script from rc.local
+
+PIDFILE=/var/run/amavis/amavisd.pid
+
+amavisd_start() {
+ if [ -x /etc/rc.d/rc.amavisd-new ]; then
+ if [ -f $PIDFILE ]; then
+ echo "amavisd-new daemon running with PID: $(cat $PIDFILE)"
+ echo "try /etc/rc.d/rc.amavisd-new stop|restart"
+ echo ""
+ exit 1
+ else
+ echo "Starting amavisd-new daemon"
+ /usr/sbin/amavisd start
+ fi
+ fi
+}
+
+amavisd_stop() {
+ if [ -f $PIDFILE ]; then
+ echo "Stopping amavisd-new daemon"
+ /usr/sbin/amavisd stop
+ else
+ echo "amavisd-new daemon is not running"
+ fi
+}
+
+amavisd_restart() {
+ echo "Restarting amavisd-new daemon"
+ amavisd_stop
+ sleep 5
+ amavisd_start
+}
+
+amavisd_status() {
+ echo "amavisd-new daemon running with PID: $(cat $PIDFILE)"
+}
+
+case "$1" in
+'start')
+ amavisd_start
+ ;;
+'stop')
+ amavisd_stop
+ ;;
+'restart')
+ amavisd_restart
+ ;;
+'status')
+ amavisd_status
+ ;;
+*)
+ echo "USAGE: $0 start|stop|restart|status"
+ exit 1
+ ;;
+esac