Updated ircd scripts to fix some channel naming fails.
[somenet/munin.git] / ircdch_
diff --git a/ircdch_ b/ircdch_
index 3beeb6bf17fbddaf3909e1684d64fc98f0f2ffd9..ec0b13c344f3f8e684b63dad4380badf5889de7c 100755 (executable)
--- a/ircdch_
+++ b/ircdch_
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright 2011 by Jan Vales <jan@jvales.net> (Someone <someone@somenet.org>)
+# Copyright 2011-2016 by Jan Vales <jan@jvales.net> (Someone <someone@somenet.org>)
 #
 #    This program is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
@@ -29,10 +29,10 @@ if [ "$1" = "config" ]; then
     echo "graph_category irc"
     echo "graph_printf %.0lf"
     echo "graph_scale no"
-    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 40
+    grep "#" "/tmp/irc_${IRCNET}/channels.txt" | sed -E -e 's~^#~~' -e 's~[^a-zA-Z0-9 ]~_~g' | sort -u | sort -k 2nr | awk '{print "H"tolower($1)".label "$1"\nH"tolower($1)".draw LINE2" }' | head -n 40
     exit 0
 fi
 
-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 20
+grep "#" "/tmp/irc_${IRCNET}/channels.txt" | sed -E -e 's~^#~~' -e 's~[^a-zA-Z0-9 ]~_~g' | sort -u | sort -k 2nr | awk '{print "H"tolower($1)".value "$2 }' | head  -n 20
 
 exit 0