From 6ae50dc1afce089ecf5595fdd13a088afe2886ca Mon Sep 17 00:00:00 2001 From: Julien Valroff Date: Sat, 23 Oct 2010 14:11:22 +0200 Subject: Imported Debian patch 1.14-1.4squeeze1 --- debian/init | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 debian/init (limited to 'debian/init') diff --git a/debian/init b/debian/init new file mode 100644 index 0000000..cd5bdff --- /dev/null +++ b/debian/init @@ -0,0 +1,60 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: mailgraph +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Mail statistics frontend for Postfix +### END INIT INFO + +MAILGRAPH_CONFIG="/etc/default/mailgraph" +NAME="mailgraph" +DAEMON="/usr/sbin/mailgraph" +PID_FILE="/var/run/mailgraph.pid" +RRD_DIR="/var/lib/mailgraph" +IGNORE_OPTION="" + +if [ -f $MAILGRAPH_CONFIG ]; then + . $MAILGRAPH_CONFIG +else + exit 0 +fi + +test -x $DAEMON || exit 0 + +if [ "$BOOT_START" = "false" ] ; then + exit 0 +fi + +if [ "$IGNORE_LOCALHOST" = "true" ]; then + IGNORE_OPTION="--ignore-localhost" +fi + +case "$1" in + start) + echo -n "Starting Postfix Mail Statistics: $NAME" + start-stop-daemon -S -q -b -p $PID_FILE -x $DAEMON -- -l $MAIL_LOG -d --daemon_rrd=$RRD_DIR $IGNORE_OPTION + echo "." + ;; + stop) + echo -n "Stopping Postfix Mail Statistics: $NAME" + if [ -f $PID_FILE ]; then + kill `cat $PID_FILE` + rm $PID_FILE + fi + echo "." + ;; + restart) + $0 stop + $0 start + ;; + force-reload) + $0 restart + ;; + *) + echo "Usage: $0 start|stop|restart|force-reload" + exit 1 + ;; +esac -- cgit v1.2.3