From a176649c3413a581532b7b4e7acc8750c14dfebc Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 26 Jul 2016 13:05:12 +0200 Subject: [PATCH 1/4] Add support to 7 days to die to info_config.sh --- lgsm/functions/info_config.sh | 53 ++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 00c9b40b5..cdc6e5785 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -293,7 +293,55 @@ fn_info_config_unreal(){ webadminpass=${webadminpass:-"NOT SET"} fi } + +fn_info_config_sdtd(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminpass="${unavailable}" + telnetenabled="${unavailable}" + telnetport="${zero}" + telnetpass="${unavailable}" + slots="${unavailable}" + gamemode="${unavailable}" + gameworld="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + port=$(grep "ServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port + 1)) + + webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + + slots=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]') + gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminpass=${webadminpass:-"NOT SET"} + telnetenabled=${telnetenabled:-"NOT SET"} + telnetport=${telnetport:-"0"} + telnetpass=${telnetpass:-"NOT SET"} + slots=${slots:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} + fi +} ## Just Cause 2 if [ "${engine}" == "avalanche" ]; then fn_info_config_avalanche @@ -329,4 +377,7 @@ elif [ "${engine}" == "terraria" ]; then # Unreal/Unreal 2 engine elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then fn_info_config_unreal -fi \ No newline at end of file +# 7 Day To Die (unity3d) +elif [ "${gamename}" == "7 Days To Die" ]; then + fn_info_config_sdtd +fi From c47626a82d93e49b57d012063e16461f9df2971b Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 17:23:36 +0200 Subject: [PATCH 2/4] Added cached memory varible Will cause no error if "cached:" doesn't exist --- lgsm/functions/info_distro.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index b75499f3d..7c5c261c7 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -63,6 +63,7 @@ fi physmemtotal=$(free ${humanreadable} | awk '/Mem:/ {print $2}') physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}') physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}') +pysmemcached=$(free ${humanreadable} | awk '/cache:/ {print $4}') swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}') swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}') swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}') @@ -111,4 +112,4 @@ if [ -d "${backupdir}" ]; then # size of most recent backup. lastbackupsize=$(du -h "${lastbackup}" | awk '{print $1}') -fi \ No newline at end of file +fi From 05d68774deddea23f3d870a80a02df2dd09f0291 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 17:42:03 +0200 Subject: [PATCH 3/4] typo --- lgsm/functions/info_distro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 7c5c261c7..9b4ba5886 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -63,7 +63,7 @@ fi physmemtotal=$(free ${humanreadable} | awk '/Mem:/ {print $2}') physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}') physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}') -pysmemcached=$(free ${humanreadable} | awk '/cache:/ {print $4}') +physmemcached=$(free ${humanreadable} | awk '/cache:/ {print $4}') swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}') swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}') swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}') From 34ab71036db575de264edcaf957f32d88924ddd2 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 17:55:43 +0200 Subject: [PATCH 4/4] Added physical cached memory info --- lgsm/functions/command_details.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 2072835be..7eb9f9933 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -42,8 +42,8 @@ fn_details_performance(){ # Uptime: 55d, 3h, 38m # Avg Load: 1.00, 1.01, 0.78 # - # Mem: total used free - # Physical: 741M 656M 85M + # Mem: total used free cached + # Physical: 741M 656M 85M 256M # Swap: 0B 0B 0B echo -e "" @@ -55,8 +55,8 @@ fn_details_performance(){ } | column -s $'\t' -t echo -e "" { - echo -e "${blue}Mem:\t${blue}total\t used\t free${default}" - echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}${default}" + echo -e "${blue}Mem:\t${blue}total\t used\t free\t cached${default}" + echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}${default}" echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}" } | column -s $'\t' -t } @@ -615,4 +615,4 @@ else fi fn_details_statusbottom -core_exit.sh \ No newline at end of file +core_exit.sh