1
0
mirror of https://github.com/cmur2/munin-mumble.git synced 2024-12-22 02:54:27 +01:00

Use grep instead of cut

This commit is contained in:
Natenom 2013-05-08 17:37:04 +02:00
parent 720991f37d
commit edcae39f28

View File

@ -18,8 +18,7 @@ PLAYERCOUNT=$(netstat -tn | grep -i ${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
MEMORYRSS=$(ps -p ${MC_PID} -o rss | cut -d'
' -f2)
MEMORYRSS=$(ps -p ${MC_PID} -o rss | grep -v RSS)
MEMGiB=$(echo "scale=2;${MEMORYRSS}/1024/1024" | bc -l)
else
MEMGiB=0