From 27d8c03916c1f394ba11b61829acf848ec02db20 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 20 Sep 2020 14:33:35 +0100 Subject: [PATCH] add post-details to check_status --- lgsm/functions/check.sh | 2 +- lgsm/functions/info_distro.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index abd198d4f..7ce2e9824 100755 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -85,7 +85,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=( DETAILS MONITOR START STOP CHANGE-PASSWORD UPDATE VALIDATE ) +allowed_commands_array=( CHANGE-PASSWORD DETAILS MONITOR START STOP UPDATE VALIDATE POST-DETAILS ) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_status.sh diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index f7500b695..97c806da2 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -97,7 +97,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}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//') # CPU usage of the game server pid -if [ "${gameserverpid}" ]; then +if [ -n "${gameserverpid}" ]; then cpuused=$(ps --forest -o pcpu -g "${gameserverpid}"|awk '{s+=$1} END {print s}') cpuusedmhz=$(echo "${cpufreqency} * ${cpuused} / 100" | bc ) fi