mirror of
https://github.com/cmur2/munin-mumble.git
synced 2024-12-22 12:54:28 +01:00
Use grep instead of cut
This commit is contained in:
parent
720991f37d
commit
edcae39f28
@ -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)
|
MC_PID=$(netstat -tlpn | grep ${MC_PORT} | sed -n -e '1p' | awk '{ print $7 }' | cut -d'/' -f1)
|
||||||
if [ ! -z "${MC_PID}" ]
|
if [ ! -z "${MC_PID}" ]
|
||||||
then #is running
|
then #is running
|
||||||
MEMORYRSS=$(ps -p ${MC_PID} -o rss | cut -d'
|
MEMORYRSS=$(ps -p ${MC_PID} -o rss | grep -v RSS)
|
||||||
' -f2)
|
|
||||||
MEMGiB=$(echo "scale=2;${MEMORYRSS}/1024/1024" | bc -l)
|
MEMGiB=$(echo "scale=2;${MEMORYRSS}/1024/1024" | bc -l)
|
||||||
else
|
else
|
||||||
MEMGiB=0
|
MEMGiB=0
|
||||||
|
Loading…
Reference in New Issue
Block a user