diff options
Diffstat (limited to 'mail/mailgraph/files')
-rw-r--r-- | mail/mailgraph/files/mailgraph.sh | 17 | ||||
-rw-r--r-- | mail/mailgraph/files/mailgraph.sh.tmpl | 38 | ||||
-rw-r--r-- | mail/mailgraph/files/patch-mailgraph.cgi | 13 |
3 files changed, 51 insertions, 17 deletions
diff --git a/mail/mailgraph/files/mailgraph.sh b/mail/mailgraph/files/mailgraph.sh deleted file mode 100644 index bfa9bc3e35ac..000000000000 --- a/mail/mailgraph/files/mailgraph.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -PREFIX=%%PREFIX%% - -case "$1" in -start) - /usr/bin/su www -c "cd ${PREFIX}/www/cgi-bin; ./mailgraph.pl -l /var/log/maillog" & > /dev/null 2>&1 && echo -n ' mailgraph' - ;; -stop) - ps -U www | grep mailgraph | awk '{print $1}' | xargs kill && echo -n ' mailgraph' - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac - -exit 0 diff --git a/mail/mailgraph/files/mailgraph.sh.tmpl b/mail/mailgraph/files/mailgraph.sh.tmpl new file mode 100644 index 000000000000..1d54483209ef --- /dev/null +++ b/mail/mailgraph/files/mailgraph.sh.tmpl @@ -0,0 +1,38 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: mailgraph +# REQUIRE: DAEMON +# KEYWORD: FreeBSD +# +# Add the following line to /etc/rc.conf to enable mailgraph: +# +# mailgraph_enable="YES" +# + +. %%RC_SUBR%% + +name=mailgraph +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/mailgraph.pl > /dev/null 2>&1 +command_interpreter=perl +stop_postcmd=stop_postcmd + +stop_postcmd() +{ + rm -f $pidfile +} + +mailgraph_enable=${mailgraph_enable:-"NO"} +mailgraph_pidfile=${mailgraph_pidfile:-"%%DATADIR%%/mailgraph.pid"} +mailgraph_flags=${mailgraph_flags:-"--logfile /var/log/maillog --daemon-rrd=%%DATADIR%% --ignore-localhost --daemon --daemon-pid=${mailgraph_pidfile}"} +mailgraph_user=${mailgraph_user:-"www"} +mailgraph_chdir=${mailgraph_chdir:-"%%DATADIR%%"} + +load_rc_config $name + +pidfile=${mailgraph_pidfile} + +run_rc_command "$1" diff --git a/mail/mailgraph/files/patch-mailgraph.cgi b/mail/mailgraph/files/patch-mailgraph.cgi new file mode 100644 index 000000000000..15bd606d673e --- /dev/null +++ b/mail/mailgraph/files/patch-mailgraph.cgi @@ -0,0 +1,13 @@ +--- mailgraph.cgi.orig Sat Feb 7 21:48:52 2004 ++++ mailgraph.cgi Mon Apr 12 02:45:53 2004 +@@ -15,8 +15,8 @@ + my $points_per_sample = 3; + my $ypoints = 150; + my $ypoints_err = 80; +-my $rrd = 'mailgraph.rrd'; # path to where the RRD database is +-my $rrd_virus = 'mailgraph_virus.rrd'; # path to where the Virus RRD database is ++my $rrd = '%%DATADIR%%/mailgraph.rrd'; # path to where the RRD database is ++my $rrd_virus = '%%DATADIR%%/mailgraph_virus.rrd'; # path to where the Virus RRD database is + my $tmp_dir = '/tmp/mailgraph'; # temporary directory where to store the images + + my @graphs = ( |