#!/bin/bash # $Id: s9y 7 2010-02-24 22:15:37Z root $ # $Rev: 7 $ # $Author: root $ # $Date: 2010-02-24 23:15:37 +0100 (Mi, 24. Feb 2010) $ # # : </tmp/s9y-env.txt if [ "$1" = "autoconf" ]; then echo no echo "Set the needed Variables in munin-node" exit 0 fi SPAM=`mysql --defaults-extra-file=$extrafile -D $database -B --skip-column-names -e "select count(*) from serendipity_spamblocklog;"` if [ "$1" = "config" ]; then echo 'graph_title Spam Entries in Serendipity' echo 'graph_args --base 1000 --lower-limit 0' echo 'graph_vlabel Entries' echo 'graph_category other' echo 'graph_total Total' echo 'graph_info counts the moderated and rejected Comment Entries in Serendipity which where classified as Spam' echo 'spam.label SPAM' echo "resettype $resettype" echo "spam.value $SPAM" exit 0 fi #### resettype? if [ -n $resettype ] then if [ "$resettype" = "monthly" ] then day=`date '+%d'` if [ $day -eq 1 && "`date '+%H%M'`" -eq 0 ] then mysql --defaults-extra-file=$extrafile -D $database -B --skip-column-names -e "delete from serendipity_spamblocklog where 1=1;" fi fi fi echo "spam.value $SPAM"