|
|
@@ -98,7 +98,7 @@ cpumodel=$(awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed
|
|
|
cpucores=$(awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo)
|
|
|
cpufreqency=$(awk -F: ' /cpu MHz/ {freq=$2} END {print freq " MHz"}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
|
|
|
# CPU usage of the game server pid
|
|
|
-if [ "${status}" == "1" ]; then
|
|
|
+if [ "${gameserverpid}" ]; then
|
|
|
cpuused=$(ps --forest -o pcpu -g "${gameserverpid}"|awk '{s+=$1} END {print s}')
|
|
|
fi
|
|
|
|
|
|
@@ -136,7 +136,7 @@ if [ -n "$(command -v numfmt 2>/dev/null)" ]; then
|
|
|
swapused=$(numfmt --to=iec --from=iec --suffix=B "$(($(grep ^SwapTotal /proc/meminfo | awk '{print $2}')-$(grep ^SwapFree /proc/meminfo | awk '{print $2}')))K")
|
|
|
# RAM usage of the game server pid
|
|
|
# MB
|
|
|
- if [ "${status}" == "1" ]; then
|
|
|
+ if [ "${gameserverpid}" ]; then
|
|
|
memused=$(ps --forest -o rss -g "${gameserverpid}" | awk '{s+=$1} END {print s}'| awk '{$1/=1024;printf "%.0fMB\t",$1}{print $2}')
|
|
|
# %
|
|
|
pmemused=$(ps --forest -o %mem -g "${gameserverpid}" | awk '{s+=$1} END {print s}')
|