From 5d69879dee018d6ab5d36ffb7305a2bf81f9b264 Mon Sep 17 00:00:00 2001
From: Someone <someone@somenet.org>
Date: Fri, 30 Aug 2013 17:46:06 +0200
Subject: [PATCH] made ircd plugins wildcardplugins
---
ircdch => ircdch_ | 8 +++++---
ircdlusers => ircdlusers_ | 9 +++++----
2 files changed, 10 insertions(+), 7 deletions(-)
rename ircdch => ircdch_ (70%)
rename ircdlusers => ircdlusers_ (74%)
diff --git a/ircdch b/ircdch_
similarity index 70%
rename from ircdch
rename to ircdch_
index 526ebe5..5c676a3 100755
--- a/ircdch
+++ b/ircdch_
@@ -21,16 +21,18 @@ if [ "$1" = "autoconf" ]; then
exit 0
fi
+IRCNET=${0##*ircdch_}
+
if [ "$1" = "config" ]; then
- echo "graph_title ircd channel stats"
+ echo "graph_title ${IRCNET} ircd channel stats"
echo "graph_info This graph shows the usercounts of the top 15 channels"
echo "graph_category irc"
echo "graph_printf %.0lf"
echo "graph_scale no"
- cat /tmp/irc_sno/channels.txt | grep "#" | sed -E -e 's~#~~g' -e 's~[^a-zA-Z0-9 ]~_~g' | sort -u | sort -k 2nr | awk '{print $1".label "$1"\n"$1".draw LINE2" }' | head -n 30
+ cat "/tmp/irc_${IRCNET}/channels.txt" | grep "#" | sed -E -e 's~#~~g' -e 's~[^a-zA-Z0-9 ]~_~g' | sort -u | sort -k 2nr | awk '{print $1".label "$1"\n"$1".draw LINE2" }' | head -n 30
exit 0
fi
-cat /tmp/irc_sno/channels.txt | grep "#" | sed -E -e 's~#~~g' -e 's~[^a-zA-Z0-9 ]~_~g' | sort -u | sort -k 2nr | awk '{print $1".value "$2 }' | head -n 15
+cat "/tmp/irc_${IRCNET}/channels.txt" | grep "#" | sed -E -e 's~#~~g' -e 's~[^a-zA-Z0-9 ]~_~g' | sort -u | sort -k 2nr | awk '{print $1".value "$2 }' | head -n 15
exit 0
diff --git a/ircdlusers b/ircdlusers_
similarity index 74%
rename from ircdlusers
rename to ircdlusers_
index 14cb49d..ab75fc3 100755
--- a/ircdlusers
+++ b/ircdlusers_
@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+IRCNET=${0##*ircdlusers_}
if [ "$1" = "autoconf" ]; then
echo "yes"
@@ -22,7 +23,7 @@ if [ "$1" = "autoconf" ]; then
fi
if [ "$1" = "config" ]; then
- echo "graph_title ircd usage stats"
+ echo "graph_title ${IRCNET} ircd usage stats"
echo "graph_info This graph shows the IRCd's stats"
echo "graph_category irc"
echo "graph_order clients channels servers"
@@ -38,7 +39,7 @@ if [ "$1" = "config" ]; then
exit 0
fi
-cat /tmp/irc_sno/lusers.txt | grep 'channels formed' | sed -e 's/\(.*\) channels formed/channels.value \1/'
-cat /tmp/irc_sno/lusers.txt | grep 'Current Global Users' | sed -e 's/Current Global Users: \(.*\) Max.*$/clients.value \1/'
-cat /tmp/irc_sno/lusers.txt | grep 'There are ' | sed -e 's/^.*on \(.*\) servers/servers.value \1/'
+cat "/tmp/irc_${IRCNET}/lusers.txt" | grep 'channels formed' | sed -e 's/\(.*\) channels formed/channels.value \1/'
+cat "/tmp/irc_${IRCNET}/lusers.txt" | grep 'Current Global Users' | sed -e 's/Current Global Users: \(.*\) Max.*$/clients.value \1/'
+cat "/tmp/irc_${IRCNET}/lusers.txt" | grep 'There are ' | sed -e 's/^.*on \(.*\) servers/servers.value \1/'
exit 0
--
2.47.3