#!/bin/sh # $Id: mailgraph-init,v 1.4 2005/06/13 11:23:22 dws Exp $ # example init script for mailgraph # # chkconfig: 2345 82 28 # description: mailgraph postfix log grapher. # # processname: mailgraph_ext.pl # pidfile: /var/run/mailgraph.pid # # mailgraph_ext - by hzqbbc PATH=/bin:/usr/bin MAILGRAPH_PL=/usr/local/mailgraph_ext/mailgraph_ext.pl MAIL_LOG=/var/log/maillog PID_FILE=/var/run/mailgraph.pid RRD_DIR=/var/lib case "$1" in 'start') echo "Starting mail statistics grapher: mailgraph_ext"; nice -19 $MAILGRAPH_PL -l $MAIL_LOG -d \ --daemon-pid=$PID_FILE --daemon-rrd=$RRD_DIR ;; 'stop') echo "Stopping mail statistics grapher: mailgraph_ext"; if [ -f $PID_FILE ]; then kill `cat $PID_FILE` rm $PID_FILE else echo "mailgraph_ext not running"; fi ;; 'restart') $0 stop $0 start ;; *) echo "Usage: $0 { start | restart | stop }" exit 1 ;; esac exit 0