diff options
author | Julien Valroff <julien@kirya.net> | 2010-10-23 14:11:22 +0200 |
---|---|---|
committer | Julien Valroff <julien@kirya.net> | 2011-03-13 18:30:14 +0100 |
commit | 6ae50dc1afce089ecf5595fdd13a088afe2886ca (patch) | |
tree | 3d3feb4f9c122b6542cb0ce8cc5750a19582a9e0 /debian/init | |
parent | 44962f21cbc5c9de2482c61b7b1cce1b81812eaa (diff) |
Imported Debian patch 1.14-1.4squeeze1debian/1.14-1.4squeeze1
Diffstat (limited to 'debian/init')
-rw-r--r-- | debian/init | 60 |
1 files changed, 60 insertions, 0 deletions
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 |