#!/bin/sh

if [ "$1" = "autoconf" ]; then
        echo "yes"
        exit 0
fi

if [ "$1" = "config" ]; then
    echo "graph_title service registrations"
    echo "graph_info This graph shows the IRC service's registration counts. Including the count of registered channels and nicknames."
    echo "graph_category irc"
    echo "graph_order channels nickaliases nickcores"
    echo "graph_printf %.0lf"
    echo "graph_scale no"
    echo "graph_args -l 0"
    echo "channels.label Registered channels"
    echo "channels.draw LINE2"
    echo "nickaliases.label Registered nicks + aliases"
    echo "nickaliases.draw LINE2"
    echo "nickcores.label Registered nicks"
    echo "nickcores.draw LINE2"
    exit 0
fi

grep -i "channels.value" /tmp/irc/servicestats.txt
grep -i "nickaliases.value" /tmp/irc/servicestats.txt
grep -i "nickcores.value" /tmp/irc/servicestats.txt

exit 0