2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Plugin minecraft-users-ram_: reduce scope of LC_LANG override

This commit is contained in:
Lars Kruse 2018-07-11 19:29:49 +02:00
parent 00149864b2
commit f6a8f2beb1

View File

@ -32,7 +32,7 @@ Some more instructions: http://wiki.natenom.name/minecraft/munin-plugin
=cut
LC_LANG=C
MC_PORT=${0##*_}
if [ "$1" = "config" ]
@ -47,7 +47,7 @@ then
exit 0
fi
PLAYERCOUNT=$(netstat -tn | grep ":$MC_PORT " | grep ESTABLISHED | wc -l)
PLAYERCOUNT=$(LC_LANG=C netstat -tn | grep ":$MC_PORT " | grep ESTABLISHED | wc -l)
MC_PID=$(netstat -tlpn | grep ":$MC_PORT " | sed -n -e '1p' | awk '{ print $7 }' | cut -d '/' -f1)
if [ ! -z "${MC_PID}" ]
then #is running