From 94822d97cce147c113aa295b9b68f08053a9f2ad Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 12 Jul 2016 16:16:25 +0100 Subject: [PATCH 01/36] added check for found log file missing build --- lgsm/functions/update_ts3.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index 3f8fb2161..a63a73128 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -22,9 +22,6 @@ fn_update_ts3_dl(){ fi } - - - fn_update_ts3_currentbuild(){ # Gets currentbuild info # Checks currentbuild info is available, if fails a server restart will be forced to generate logs. @@ -33,10 +30,10 @@ fn_update_ts3_currentbuild(){ sleep 1 fn_print_error_nl "Checking for update: teamspeak.com: No logs with server version found" fn_script_log_error "Checking for update: teamspeak.com: No logs with server version found" - sleep 2 + sleep 1 fn_print_info_nl "Checking for update: teamspeak.com: Forcing server restart" fn_script_log_info "Checking for update: teamspeak.com: Forcing server restart" - sleep 2 + sleep 1 exitbypass=1 command_stop.sh exitbypass=1 @@ -51,6 +48,23 @@ fn_update_ts3_currentbuild(){ fi currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') + if [ -z "${currentbuild}" ]; then + fn_print_error_nl "Checking for update: teamspeak.com: Current build version not found" + fn_script_log_error "Checking for update: teamspeak.com: Current build version not found" + sleep 1 + fn_print_info_nl "Checking for update: teamspeak.com: Forcing server restart" + fn_script_log_info "Checking for update: teamspeak.com: Forcing server restart" + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') + if [ -z "${currentbuild}" ]; then + fn_print_fail_nl "Checking for update: teamspeak.com: Current build version still not found" + fn_script_log_fatal "Checking for update: teamspeak.com: Current build version still not found" + core_exit.sh + fi + fi } fn_update_ts3_arch(){ From 9bf343a9c76163c30f2d0b6fed633493bd882449 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 12 Jul 2016 23:11:09 +0100 Subject: [PATCH 02/36] Fixes #842 --- lgsm/functions/info_parms.sh | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index d4cba6548..070a52260 100644 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -45,30 +45,6 @@ fn_info_config_source(){ clientport=${clientport:-"0"} } -fn_info_config_teamspeak3(){ - if [ ! -f "${servercfgfullpath}" ]; then - dbplugin="${unavailable}" - port="9987" - queryport="10011" - fileport="30033" - else - # check if the ip exists in the config file. Failing this will fall back to the default. - ipconfigcheck=$(grep "voice_ip=" "${servercfgfullpath}" | sed 's/\voice_ip=//g') - if [ -n "${ipconfigcheck}" ]; then - ip="${ipconfigcheck}" - fi - dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed 's/\dbplugin=//g') - port=$(grep "default_voice_port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$(grep "query_port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fileport=$(grep "filetransfer_port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not Set - port=${port:-"9987"} - queryport=${queryport:-"10011"} - fileport=${fileport:-"30033"} - fi -} - fn_info_config_teeworlds(){ if [ ! -f "${servercfgfullpath}" ]; then servername="unnamed server" @@ -164,8 +140,6 @@ elif [ "${engine}" == "seriousengine35" ]; then # Source Engine Games elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then fn_info_config_source -elif [ "${gamename}" == "Teamspeak 3" ]; then - fn_info_config_teamspeak3 # Teeworlds elif [ "${engine}" == "teeworlds" ]; then fn_info_config_teeworlds From 7cb0b97c574324c2d2e43be545d7e6f852f5ba7e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 13 Jul 2016 12:14:16 +0100 Subject: [PATCH 03/36] added GSLT --- NoMoreRoomInHell/nmrihserver | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver index 42296b71b..079726c28 100644 --- a/NoMoreRoomInHell/nmrihserver +++ b/NoMoreRoomInHell/nmrihserver @@ -9,7 +9,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="210516" +version="130716" #### Variables #### @@ -38,9 +38,14 @@ clientport="27005" ip="0.0.0.0" updateonstart="off" +# Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://gameservermanagers.com/gslt +gslt="" + # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server fn_parms(){ -parms="-game nmrih -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +parms="-game nmrih -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" } #### Advanced Variables #### From 2319b8a2c14213b186f727d3ffda3d1d7a766a31 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 15 Jul 2016 18:49:17 +0100 Subject: [PATCH 04/36] commandadction to commandname --- lgsm/functions/core_messages.sh | 72 ++++++++++++++++----------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 3efc7a41f..6f3741708 100644 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -25,8 +25,8 @@ fi ########## ## Feb 28 14:56:58 ut99-server: Monitor: fn_script_log(){ - if [ -n "${commandaction}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandaction}: ${1}" >> "${scriptlog}" + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: ${1}" >> "${scriptlog}" else echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}" fi @@ -34,8 +34,8 @@ fn_script_log(){ ## Feb 28 14:56:58 ut99-server: Monitor: PASS: fn_script_log_pass(){ - if [ -n "${commandaction}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandaction}: PASS: ${1}" >> "${scriptlog}" + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: PASS: ${1}" >> "${scriptlog}" else echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: PASS: ${1}" >> "${scriptlog}" fi @@ -44,8 +44,8 @@ fn_script_log_pass(){ ## Feb 28 14:56:58 ut99-server: Monitor: FATAL: fn_script_log_fatal(){ - if [ -n "${commandaction}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandaction}: FATAL: ${1}" >> "${scriptlog}" + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: FATAL: ${1}" >> "${scriptlog}" else echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: FATAL: ${1}" >> "${scriptlog}" fi @@ -54,8 +54,8 @@ fn_script_log_fatal(){ ## Feb 28 14:56:58 ut99-server: Monitor: ERROR: fn_script_log_error(){ - if [ -n "${commandaction}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandaction}: ERROR: ${1}" >> "${scriptlog}" + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: ERROR: ${1}" >> "${scriptlog}" else echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ERROR: ${1}" >> "${scriptlog}" fi @@ -64,8 +64,8 @@ fn_script_log_error(){ ## Feb 28 14:56:58 ut99-server: Monitor: WARN: fn_script_log_warn(){ - if [ -n "${commandaction}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandaction}: WARN: ${1}" >> "${scriptlog}" + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: WARN: ${1}" >> "${scriptlog}" else echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: WARN: ${1}" >> "${scriptlog}" fi @@ -74,8 +74,8 @@ fn_script_log_warn(){ ## Feb 28 14:56:58 ut99-server: Monitor: INFO: fn_script_log_info(){ - if [ -n "${commandaction}" ]; then - echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandaction}: INFO: ${1}" >> "${scriptlog}" + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${commandname}: INFO: ${1}" >> "${scriptlog}" else echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: INFO: ${1}" >> "${scriptlog}" fi @@ -86,16 +86,16 @@ fn_script_log_info(){ # [ .... ] fn_print_dots(){ - if [ -n "${commandaction}" ]; then - echo -en "${creeol}[ .... ] ${commandaction} ${servicename}: $@" + if [ -n "${commandname}" ]; then + echo -en "${creeol}[ .... ] ${commandname} ${servicename}: $@" else echo -en "${creeol}[ .... ] $@" fi } fn_print_dots_nl(){ - if [ -n "${commandaction}" ]; then - echo -e "${creeol}[ .... ] ${commandaction} ${servicename}: $@" + if [ -n "${commandname}" ]; then + echo -e "${creeol}[ .... ] ${commandname} ${servicename}: $@" else echo -e "${creeol}[ .... ] $@" fi @@ -105,16 +105,16 @@ fn_print_dots_nl(){ # [ OK ] fn_print_ok(){ - if [ -n "${commandaction}" ]; then - echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${servicename}: $@" + if [ -n "${commandname}" ]; then + echo -en "${creeol}[${green} OK ${default}] ${commandname} ${servicename}: $@" else echo -en "${creeol}[${green} OK ${default}] $@" fi } fn_print_ok_nl(){ - if [ -n "${commandaction}" ]; then - echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${servicename}: $@" + if [ -n "${commandname}" ]; then + echo -en "${creeol}[${green} OK ${default}] ${commandname} ${servicename}: $@" else echo -en "${creeol}[${green} OK ${default}] $@" fi @@ -124,16 +124,16 @@ fn_print_ok_nl(){ # [ FAIL ] fn_print_fail(){ - if [ -n "${commandaction}" ]; then - echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${servicename}: $@" + if [ -n "${commandname}" ]; then + echo -en "${creeol}[${red} FAIL ${default}] ${commandname} ${servicename}: $@" else echo -en "${creeol}[${red} FAIL ${default}] $@" fi } fn_print_fail_nl(){ - if [ -n "${commandaction}" ]; then - echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${servicename}: $@" + if [ -n "${commandname}" ]; then + echo -en "${creeol}[${red} FAIL ${default}] ${commandname} ${servicename}: $@" else echo -en "${creeol}[${red} FAIL ${default}] $@" fi @@ -143,16 +143,16 @@ fn_print_fail_nl(){ # [ ERROR ] fn_print_error(){ - if [ -n "${commandaction}" ]; then - echo -en "${creeol}[${red}ERROR ${default}] ${commandaction} ${servicename}: $@" + if [ -n "${commandname}" ]; then + echo -en "${creeol}[${red}ERROR ${default}] ${commandname} ${servicename}: $@" else echo -en "${creeol}[${red}ERROR ${default}] $@" fi } fn_print_error_nl(){ - if [ -n "${commandaction}" ]; then - echo -en "${creeol}[${red}ERROR ${default}] ${commandaction} ${servicename}: $@" + if [ -n "${commandname}" ]; then + echo -en "${creeol}[${red}ERROR ${default}] ${commandname} ${servicename}: $@" else echo -en "${creeol}[${red}ERROR ${default}] $@" fi @@ -162,16 +162,16 @@ fn_print_error_nl(){ # [ WARN ] fn_print_warn(){ - if [ -n "${commandaction}" ]; then - echo -en "${creeol}[${yellow} WARN ${default}] ${commandaction} ${servicename}: $@" + if [ -n "${commandname}" ]; then + echo -en "${creeol}[${yellow} WARN ${default}] ${commandname} ${servicename}: $@" else echo -en "${creeol}[${yellow} WARN ${default}] $@" fi } fn_print_warn_nl(){ - if [ -n "${commandaction}" ]; then - echo -en "${creeol}[${yellow} WARN ${default}] ${commandaction} ${servicename}: $@" + if [ -n "${commandname}" ]; then + echo -en "${creeol}[${yellow} WARN ${default}] ${commandname} ${servicename}: $@" else echo -en "${creeol}[${yellow} WARN ${default}] $@" fi @@ -181,16 +181,16 @@ fn_print_warn_nl(){ # [ INFO ] fn_print_info(){ - if [ -n "${commandaction}" ]; then - echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${servicename}: $@" + if [ -n "${commandname}" ]; then + echo -en "${creeol}[${cyan} INFO ${default}] ${commandname} ${servicename}: $@" else echo -en "${creeol}[${cyan} INFO ${default}] $@" fi } fn_print_info_nl(){ - if [ -n "${commandaction}" ]; then - echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${servicename}: $@" + if [ -n "${commandname}" ]; then + echo -en "${creeol}[${cyan} INFO ${default}] ${commandname} ${servicename}: $@" else echo -en "${creeol}[${cyan} INFO ${default}] $@" fi From 29965a732b5db79247e9742aee1310a67844bdab Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 15 Jul 2016 19:42:47 +0100 Subject: [PATCH 05/36] updated comment --- lgsm/functions/update_ts3.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index a63a73128..3745eed49 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -1,8 +1,8 @@ #!/bin/bash -# LGSM command_update.sh function +# LGSM command_ts3.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description:Handles updating of teamspeak 3 servers. +# Description: Handles updating of teamspeak 3 servers. local commandname="UPDATE" local commandaction="Update" From f7978da8016f49f77b7f6e39affbcd56b3191a20 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 16 Jul 2016 11:45:55 +0100 Subject: [PATCH 06/36] commandaction for print commandname for script --- lgsm/functions/core_messages.sh | 48 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 6f3741708..2118843c6 100644 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -86,16 +86,16 @@ fn_script_log_info(){ # [ .... ] fn_print_dots(){ - if [ -n "${commandname}" ]; then - echo -en "${creeol}[ .... ] ${commandname} ${servicename}: $@" + if [ -n "${commandaction}" ]; then + echo -en "${creeol}[ .... ] ${commandaction} ${servicename}: $@" else echo -en "${creeol}[ .... ] $@" fi } fn_print_dots_nl(){ - if [ -n "${commandname}" ]; then - echo -e "${creeol}[ .... ] ${commandname} ${servicename}: $@" + if [ -n "${commandaction}" ]; then + echo -e "${creeol}[ .... ] ${commandaction} ${servicename}: $@" else echo -e "${creeol}[ .... ] $@" fi @@ -105,16 +105,16 @@ fn_print_dots_nl(){ # [ OK ] fn_print_ok(){ - if [ -n "${commandname}" ]; then - echo -en "${creeol}[${green} OK ${default}] ${commandname} ${servicename}: $@" + if [ -n "${commandaction}" ]; then + echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${servicename}: $@" else echo -en "${creeol}[${green} OK ${default}] $@" fi } fn_print_ok_nl(){ - if [ -n "${commandname}" ]; then - echo -en "${creeol}[${green} OK ${default}] ${commandname} ${servicename}: $@" + if [ -n "${commandaction}" ]; then + echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${servicename}: $@" else echo -en "${creeol}[${green} OK ${default}] $@" fi @@ -124,16 +124,16 @@ fn_print_ok_nl(){ # [ FAIL ] fn_print_fail(){ - if [ -n "${commandname}" ]; then - echo -en "${creeol}[${red} FAIL ${default}] ${commandname} ${servicename}: $@" + if [ -n "${commandaction}" ]; then + echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${servicename}: $@" else echo -en "${creeol}[${red} FAIL ${default}] $@" fi } fn_print_fail_nl(){ - if [ -n "${commandname}" ]; then - echo -en "${creeol}[${red} FAIL ${default}] ${commandname} ${servicename}: $@" + if [ -n "${commandaction}" ]; then + echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${servicename}: $@" else echo -en "${creeol}[${red} FAIL ${default}] $@" fi @@ -143,16 +143,16 @@ fn_print_fail_nl(){ # [ ERROR ] fn_print_error(){ - if [ -n "${commandname}" ]; then - echo -en "${creeol}[${red}ERROR ${default}] ${commandname} ${servicename}: $@" + if [ -n "${commandaction}" ]; then + echo -en "${creeol}[${red}ERROR ${default}] ${commandaction} ${servicename}: $@" else echo -en "${creeol}[${red}ERROR ${default}] $@" fi } fn_print_error_nl(){ - if [ -n "${commandname}" ]; then - echo -en "${creeol}[${red}ERROR ${default}] ${commandname} ${servicename}: $@" + if [ -n "${commandaction}" ]; then + echo -en "${creeol}[${red}ERROR ${default}] ${commandaction} ${servicename}: $@" else echo -en "${creeol}[${red}ERROR ${default}] $@" fi @@ -162,16 +162,16 @@ fn_print_error_nl(){ # [ WARN ] fn_print_warn(){ - if [ -n "${commandname}" ]; then - echo -en "${creeol}[${yellow} WARN ${default}] ${commandname} ${servicename}: $@" + if [ -n "${commandaction}" ]; then + echo -en "${creeol}[${yellow} WARN ${default}] ${commandaction} ${servicename}: $@" else echo -en "${creeol}[${yellow} WARN ${default}] $@" fi } fn_print_warn_nl(){ - if [ -n "${commandname}" ]; then - echo -en "${creeol}[${yellow} WARN ${default}] ${commandname} ${servicename}: $@" + if [ -n "${commandaction}" ]; then + echo -en "${creeol}[${yellow} WARN ${default}] ${commandaction} ${servicename}: $@" else echo -en "${creeol}[${yellow} WARN ${default}] $@" fi @@ -181,16 +181,16 @@ fn_print_warn_nl(){ # [ INFO ] fn_print_info(){ - if [ -n "${commandname}" ]; then - echo -en "${creeol}[${cyan} INFO ${default}] ${commandname} ${servicename}: $@" + if [ -n "${commandaction}" ]; then + echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${servicename}: $@" else echo -en "${creeol}[${cyan} INFO ${default}] $@" fi } fn_print_info_nl(){ - if [ -n "${commandname}" ]; then - echo -en "${creeol}[${cyan} INFO ${default}] ${commandname} ${servicename}: $@" + if [ -n "${commandaction}" ]; then + echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${servicename}: $@" else echo -en "${creeol}[${cyan} INFO ${default}] $@" fi From 038a49bad0ae9077e23b4c40a5478a2493cf9f96 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 16 Jul 2016 22:39:40 +0100 Subject: [PATCH 07/36] Changed to serverfiles for now the rootdir is commonly the home dir. It has been highlighted that sometimes dirs in the home dir may not belong to the user. I will make further improvements to permissions soon. --- lgsm/functions/check_permissions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index 584ea4695..7c1c92b5b 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -9,14 +9,14 @@ local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_check_ownership(){ - if [ $(find "${rootdir}" -not -user $(whoami)|wc -l) -ne "0" ]; then + if [ $(find "${serverfiles}" -not -user $(whoami)|wc -l) -ne "0" ]; then fn_print_fail_nl "Permissions issues found" fn_script_log_fatal "Permissions issues found" fn_print_infomation_nl "The current user ($(whoami)) does not have ownership of the following files:" fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:" { echo -e "User\tGroup\tFile\n" - find "${rootdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" + find "${serverfiles}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" } | column -s $'\t' -t | tee -a "${scriptlog}" core_exit.sh fi From b172f59d80d831543baa14ce4719917a48820f82 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Jul 2016 18:37:19 +0100 Subject: [PATCH 08/36] tmux check not required for teamspeak 3 --- lgsm/functions/check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index bb92bc8af..d8a529abc 100644 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -63,7 +63,7 @@ done local allowed_commands_array=( command_console.sh command_start.sh ) for allowed_command in "${allowed_commands_array[@]}" do - if [ "${allowed_command}" == "${function_selfname}" ]; then + if [ "${allowed_command}" == "${function_selfname}" ][ "${gamename}" != "Teamspeak 3" ]; then check_tmux.sh fi done From e2ac1361a4d9cf2e70a7fe0a7a10fc1eca6e3efa Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Jul 2016 18:45:42 +0100 Subject: [PATCH 09/36] filesdir not serverfiles --- lgsm/functions/check_permissions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index 7c1c92b5b..7fcc0d333 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -9,14 +9,14 @@ local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_check_ownership(){ - if [ $(find "${serverfiles}" -not -user $(whoami)|wc -l) -ne "0" ]; then + if [ $(find "${filesdir}" -not -user $(whoami)|wc -l) -ne "0" ]||$(find "${rootdir}/${selfname}" -not -user $(whoami)|wc -l) -ne "0" ]; then fn_print_fail_nl "Permissions issues found" fn_script_log_fatal "Permissions issues found" fn_print_infomation_nl "The current user ($(whoami)) does not have ownership of the following files:" fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:" { echo -e "User\tGroup\tFile\n" - find "${serverfiles}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" + find "${filesdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" } | column -s $'\t' -t | tee -a "${scriptlog}" core_exit.sh fi From 9b5af1b22f1f2896e3dfff1f708644f3d2522bc1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Jul 2016 18:47:17 +0100 Subject: [PATCH 10/36] missing bracket --- lgsm/functions/check_permissions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index 7fcc0d333..2eb312312 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -9,7 +9,7 @@ local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_check_ownership(){ - if [ $(find "${filesdir}" -not -user $(whoami)|wc -l) -ne "0" ]||$(find "${rootdir}/${selfname}" -not -user $(whoami)|wc -l) -ne "0" ]; then + if [ $(find "${filesdir}" -not -user $(whoami)|wc -l) -ne "0" ]||[ $(find "${rootdir}/${selfname}" -not -user $(whoami)|wc -l) -ne "0" ]; then fn_print_fail_nl "Permissions issues found" fn_script_log_fatal "Permissions issues found" fn_print_infomation_nl "The current user ($(whoami)) does not have ownership of the following files:" From d84114f6e961bb4c4196fb4c00b191d13e6881b1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Jul 2016 18:47:39 +0100 Subject: [PATCH 11/36] or --- lgsm/functions/check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index d8a529abc..95e1a92ba 100644 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -63,7 +63,7 @@ done local allowed_commands_array=( command_console.sh command_start.sh ) for allowed_command in "${allowed_commands_array[@]}" do - if [ "${allowed_command}" == "${function_selfname}" ][ "${gamename}" != "Teamspeak 3" ]; then + if [ "${allowed_command}" == "${function_selfname}" ]||[ "${gamename}" != "Teamspeak 3" ]; then check_tmux.sh fi done From 997dc006fdb28415c24feae46519cee6bd4368ac Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 17 Jul 2016 22:48:26 +0100 Subject: [PATCH 12/36] corrected message display --- lgsm/functions/command_validate.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh index e5042f269..2054396ce 100644 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/functions/command_validate.sh @@ -13,7 +13,7 @@ fn_validation(){ echo -en " * https://developer.valvesoftware.com/wiki/SteamCMD#Validate" sleep 3 echo -en "\n" - fn_print_dots_nl "Validating files: SteamCMD" + fn_script_log_info "Validating files: SteamCMD" sleep 1 @@ -39,7 +39,9 @@ fn_validation(){ } -fn_print_dots "Validating files" +fn_print_dots_nl "Validating files:" +sleep 0.5 +fn_print_dots_nl "Validating files: SteamCMD" sleep 1 check.sh check_status.sh From 3a291bc5700d54cc29b32c63adb01b61bd92b024 Mon Sep 17 00:00:00 2001 From: Marvin Lehmann Date: Sat, 23 Jul 2016 01:37:08 +0200 Subject: [PATCH 13/36] Fixed case --- {StarBound => Starbound}/cfg/sbboot.config | 0 {StarBound => Starbound}/sbserver | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {StarBound => Starbound}/cfg/sbboot.config (100%) rename {StarBound => Starbound}/sbserver (100%) diff --git a/StarBound/cfg/sbboot.config b/Starbound/cfg/sbboot.config similarity index 100% rename from StarBound/cfg/sbboot.config rename to Starbound/cfg/sbboot.config diff --git a/StarBound/sbserver b/Starbound/sbserver similarity index 100% rename from StarBound/sbserver rename to Starbound/sbserver From a60432b0c30d75c45bc87373eddc4b727073f59b Mon Sep 17 00:00:00 2001 From: Marvin Lehmann Date: Sat, 23 Jul 2016 01:44:25 +0200 Subject: [PATCH 14/36] Added support for Starbound 1.0 - removed deprecated file "sbboot.config" - added new default config - fixed details - new structure --- Starbound/cfg/lgsm-default.config | 49 +++++++++++ Starbound/cfg/sbboot.config | 141 ------------------------------ Starbound/sbserver | 11 +-- lgsm/functions/info_config.sh | 29 ++++++ lgsm/functions/install_config.sh | 6 ++ 5 files changed, 90 insertions(+), 146 deletions(-) create mode 100644 Starbound/cfg/lgsm-default.config delete mode 100644 Starbound/cfg/sbboot.config diff --git a/Starbound/cfg/lgsm-default.config b/Starbound/cfg/lgsm-default.config new file mode 100644 index 000000000..275898d2b --- /dev/null +++ b/Starbound/cfg/lgsm-default.config @@ -0,0 +1,49 @@ +{ + "allowAdminCommands" : true, + "allowAdminCommandsFromAnyone" : false, + "allowAnonymousConnections" : true, + "allowAssetsMismatch" : true, + "anonymousConnectionsAreAdmin" : false, + "bannedIPs" : [], + "bannedUuids" : [], + "checkAssetsDigest" : false, + "clearPlayerFiles" : false, + "clearUniverseFiles" : false, + "clientIPJoinable" : false, + "clientP2PJoinable" : true, + "configurationVersion" : { + "basic" : 1, + "server" : 4 + }, + "crafting" : { + "filterHaveMaterials" : false + }, + "gameServerBind" : "::", + "gameServerPort" : 21025, + "interactiveHighlight" : true, + "inventory" : { + "pickupToActionBar" : true + }, + "maxPlayers" : 8, + "maxTeamSize" : 4, + "playerBackupFileCount" : 3, + "queryServerBind" : "::", + "queryServerPort" : 21025, + "rconServerBind" : "::", + "rconServerPassword" : "", + "rconServerPort" : 21026, + "rconServerTimeout" : 1000, + "runQueryServer" : false, + "runRconServer" : false, + "safeScripts" : true, + "scriptInstructionLimit" : 10000000, + "scriptInstructionMeasureInterval" : 10000, + "scriptProfilingEnabled" : false, + "scriptRecursionLimit" : 100, + "serverFidelity" : "automatic", + "serverName" : "", + "serverOverrideAssetsDigest" : null, + "serverUsers" : { + }, + "tutorialMessages" : true +} \ No newline at end of file diff --git a/Starbound/cfg/sbboot.config b/Starbound/cfg/sbboot.config deleted file mode 100644 index 62f133536..000000000 --- a/Starbound/cfg/sbboot.config +++ /dev/null @@ -1,141 +0,0 @@ -{ - "handleFatalSignals" : true, - "handleInterruptSignal" : true, - "rootMaintenanceSleep" : 5000, - "logFileBackups" : 5, - "assetSources" : [ - "../assets/packed.pak", - "../assets/user" - ], - "modSource" : "../giraffe_storage/mods/", - "storageDirectory" : "../giraffe_storage/", - "defaultConfiguration" : { - "gameServerPort" : 21025, - "gameServerBind" : "*", - - "serverUsers" : {}, - "allowAnonymousConnections" : true, - - "bannedUuids" : [], - "bannedIPs" : [], - - "serverName" : "A Starbound Server", - "maxPlayers" : 8, - "upnpPortForwarding" : true, - - "checkAssetsDigest" : false, - - "allowAdminCommands" : true, - "allowAdminCommandsFromAnyone" : false, - "anonymousConnectionsAreAdmin" : false, - - "runQueryServer" : false, - "queryServerPort" : 21025, - "queryServerBind" : "*", - - "runRconServer" : false, - "rconServerPort" : 21026, - "rconServerBind" : "*", - "rconServerPassword" : "", - "rconServerTimeout" : 1000, - - "windowTitle" : "Starbound - Beta", - "vsync" : true, - "renderSleep" : true, - "maxFrameSkip" : 10, - "sampleRate" : 44100, - "audioChannels" : 2, - "audioChannelSeparation" : [-25, 25], - - "clearUniverseFiles" : false, - "clearPlayerFiles" : false, - "playerBackupFileCount" : 3, - - "sfxVol" : 100, - "musicVol" : 100, - "windowedResolution" : [1000, 600], - "maximizedResolution" : [1000, 600], - "fullscreenResolution" : [1920, 1080], - "fullscreen" : false, - "maximized" : true, - "zoomLevel" : 3.0, - "speechBubbles" : true, - - "crafting.filterHaveMaterials" : false, - "title.connectionString" : "", - - "bindings" : { - "PlayerUp" : [ { "type" : "key", "value" : "W", "mods" : [] } ], - "PlayerDown" : [ { "type" : "key", "value" : "S", "mods" : [] } ], - "PlayerLeft" : [ { "type" : "key", "value" : "A", "mods" : [] } ], - "PlayerRight" : [ { "type" : "key", "value" : "D", "mods" : [] } ], - "PlayerJump" : [ { "type" : "key", "value" : "Space", "mods" : [] } ], - "PlayerDropItem" : [ { "type" : "key", "value" : "Q", "mods" : [] } ], - "PlayerInteract" : [ { "type" : "key", "value" : "E", "mods" : [] } ], - "PlayerShifting" : [ { "type" : "key", "value" : "RShift", "mods" : [] }, { "type" : "key", "value" : "LShift", "mods" : [] } ], - "PlayerTechAction1" : [ { "type" : "key", "value" : "F", "mods" : [] } ], - "PlayerTechAction2" : [ { "type" : "key", "value" : "G", "mods" : [] } ], - "PlayerTechAction3" : [ { "type" : "key", "value" : "H", "mods" : [] } ], - "EmoteBlabbering" : [ { "type" : "key", "value" : "Right", "mods" : ["LCt rl", "LShift"] } ], - "EmoteShouting" : [ { "type" : "key", "value" : "Up", "mods" : ["LCtrl", "LAlt"] } ], - "EmoteHappy" : [ { "type" : "key", "value" : "Up", "mods" : [] } ], - "EmoteSad" : [ { "type" : "key", "value" : "Down", "mods" : [] } ], - "EmoteNeutral" : [ { "type" : "key", "value" : "Left", "mods" : [] } ], - "EmoteLaugh" : [ { "type" : "key", "value" : "Left", "mods" : [ "LCtrl" ] } ], - "EmoteAnnoyed" : [ { "type" : "key", "value" : "Right", "mods" : [] } ], - "EmoteOh" : [ { "type" : "key", "value" : "Right", "mods" : [ "LCtrl" ] } ], - "EmoteOooh" : [ { "type" : "key", "value" : "Down", "mods" : [ "LCtrl" ] } ], - "EmoteBlink" : [ { "type" : "key", "value" : "Up", "mods" : [ "LCtrl" ] } ], - "EmoteWink" : [ { "type" : "key", "value" : "Up", "mods" : ["LCtrl", "LSh ift"] } ], - "EmoteEat" : [ { "type" : "key", "value" : "Down", "mods" : ["LCtrl", "LS hift"] } ], - "EmoteSleep" : [ { "type" : "key", "value" : "Left", "mods" : ["LCtrl", " LShift"] } ], - "ShowLabels" : [ { "type" : "key", "value" : "RAlt", "mods" : [] }, { "ty pe" : "key", "value" : "LAlt", "mods" : [] } ], - "CameraShift" : [ { "type" : "key", "value" : "RCtrl", "mods" : [] }, { " type" : "key", "value" : "LCtrl", "mods" : [] } ], - "CockpitUp" : [ { "type" : "key", "value" : "W", "mods" : [] }, { "type" : "key", "value" : "Up", "mods" : [] } ], - "CockpitDown" : [ { "type" : "key", "value" : "S", "mods" : [] }, { "type " : "key", "value" : "Down", "mods" : [] } ], - "CockpitLeft" : [ { "type" : "key", "value" : "Left", "mods" : [] }, { "t ype" : "key", "value" : "A", "mods" : [] } ], - "CockpitRight" : [ { "type" : "key", "value" : "Right", "mods" : [] }, { "type" : "key", "value" : "D", "mods" : [] } ], - "TitleBack" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ], - "CinematicSkip" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ], - "CinematicNext" : [ { "type" : "key", "value" : "Right", "mods" : [] }, { "type" : "key", "value" : "Return", "mods" : [] } ], - "GuiClose" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ], - "GuiShifting" : [ { "type" : "key", "value" : "RShift", "mods" : [] }, { "type" : "key", "value" : "LShift", "mods" : [] } ], - "KeybindingCancel" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ] , - "KeybindingClear" : [ { "type" : "key", "value" : "Del", "mods" : [] }, { "type" : "key", "value" : "Backspace", "mods" : [] } ], - "ChatPageUp" : [ { "type" : "key", "value" : "PageUp", "mods" : [] } ], - "ChatPageDown" : [ { "type" : "key", "value" : "PageDown", "mods" : [] } ], - "ChatPreviousLine" : [ { "type" : "key", "value" : "Up", "mods" : [] } ], - "ChatNextLine" : [ { "type" : "key", "value" : "Down", "mods" : [] } ], - "ChatSendLine" : [ { "type" : "key", "value" : "Return", "mods" : [] } ], - "ChatBegin" : [ { "type" : "key", "value" : "Return", "mods" : [] } ], - "ChatBeginCommand" : [ { "type" : "key", "value" : "/", "mods" : [] } ], - "ChatStop" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ], - "InterfaceShowHelp" : [ { "type" : "key", "value" : "F1", "mods" : [] } ] , - "InterfaceHideHud" : [ { "type" : "key", "value" : "Z", "mods" : [ "LAlt" ] } ], - "InterfaceSwapHands" : [ { "type" : "key", "value" : "Z", "mods" : [] } ] , - "InterfaceDeselectHands" : [ { "type" : "key", "value" : "X", "mods" : [] } ], - "InterfaceBar1" : [ { "type" : "key", "value" : "1", "mods" : [] } ], - "InterfaceBar2" : [ { "type" : "key", "value" : "2", "mods" : [] } ], - "InterfaceBar3" : [ { "type" : "key", "value" : "3", "mods" : [] } ], - "InterfaceBar4" : [ { "type" : "key", "value" : "4", "mods" : [] } ], - "InterfaceBar5" : [ { "type" : "key", "value" : "5", "mods" : [] } ], - "InterfaceBar6" : [ { "type" : "key", "value" : "6", "mods" : [] } ], - "InterfaceBar7" : [ { "type" : "key", "value" : "7", "mods" : [] } ], - "InterfaceBar8" : [ { "type" : "key", "value" : "8", "mods" : [] } ], - "InterfaceBar9" : [ { "type" : "key", "value" : "9", "mods" : [] } ], - "InterfaceBar10" : [ { "type" : "key", "value" : "0", "mods" : [] } ], - "EssentialBar1" : [ { "type" : "key", "value" : "R", "mods" : [] } ], - "EssentialBar2" : [ { "type" : "key", "value" : "T", "mods" : [] } ], - "EssentialBar3" : [ { "type" : "key", "value" : "Y", "mods" : [] } ], - "InterfaceBarNPos" : [ { "type" : "key", "value" : "-", "mods" : [] }, { "type" : "key", "value" : "`", "mods" : [] } ], - "InterfaceRepeatCommand" : [ { "type" : "key", "value" : "P", "mods" : [] } ], - "InterfaceToggleFullscreen" : [ { "type" : "key", "value" : "F11", "mods" : [] } ], - "InterfaceEscapeMenu" : [ { "type" : "key", "value" : "Esc", "mods" : [] } ], - "InterfaceInventory" : [ { "type" : "key", "value" : "I", "mods" : [] } ] , - "InterfaceCodex" : [ { "type" : "key", "value" : "L", "mods" : [] } ], - "InterfaceQuest" : [ { "type" : "key", "value" : "J", "mods" : [] } ], - "InterfaceCrafting" : [ { "type" : "key", "value" : "C", "mods" : [] } ], - "InterfaceInspectCursor" : [ { "type" : "key", "value" : "N", "mods" : [] } ] - } - } -} diff --git a/Starbound/sbserver b/Starbound/sbserver index ac1cfa757..ae779c627 100644 --- a/Starbound/sbserver +++ b/Starbound/sbserver @@ -9,7 +9,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="210516" +version="230716" #### Variables #### @@ -62,16 +62,17 @@ lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" -executabledir="${filesdir}/linux64" +executabledir="${filesdir}/linux" executable="./starbound_server" -servercfg="sbboot.config" -servercfgdir="${executabledir}" +servercfg="starbound_server.config" +servercfgdir="${filesdir}/storage" servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/lgsm-default.config" backupdir="${rootdir}/backups" # Logging logdays="7" -gamelogdir="${filesdir}/giraffe_storage" +gamelogdir="${filesdir}/storage" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" consolelogging="on" diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index deb7367c7..00c9b40b5 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -161,6 +161,32 @@ fn_info_config_source(){ fi } +fn_info_config_starbound(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + port="21025" + queryport="21025" + rconport="21026" + slots="8" + else + servername=$(grep "serverName" "${servercfgfullpath}" | sed 's/"serverName" \: //g' | grep -oP '"\K[^"]+(?=["])') + rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed 's/"rconServerPassword" \: //g' | grep -oP '"\K[^"]+(?=["])') + port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + rconport=$(grep "rconServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + slots=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + port=${port:-"21025"} + queryport=${queryport:-"21025"} + rconport=${rconport:-"21026"} + slots=${slots:-"8"} + fi +} + fn_info_config_teamspeak3(){ if [ ! -f "${servercfgfullpath}" ]; then dbplugin="${unavailable}" @@ -289,6 +315,9 @@ elif [ "${engine}" == "seriousengine35" ]; then # Source Engine Games elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then fn_info_config_source +# Starbound +elif [ "${engine}" == "starbound" ]; then + fn_info_config_starbound elif [ "${gamename}" == "Teamspeak 3" ]; then fn_info_config_teamspeak3 # Teeworlds diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 4b7d26cbf..7e0438b6b 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -335,6 +335,12 @@ elif [ "${gamename}" == "Sven Co-op" ]; then wget -N /dev/null ${githuburl}/SvenCoop/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq sleep 1 fn_goldsourceconfig +elif [ "${gamename}" == "Starbound" ]; then + echo -e "downloading lgsm-default.config...\c" + wget -N /dev/null ${githuburl}/Starbound/cfg/lgsm-default.config 2>&1 | grep -F HTTP | cut -c45- | uniq + sleep 1 + fn_defaultconfig + fn_userinputconfig elif [ "${gamename}" == "Teamspeak 3" ]; then echo -e "downloading lgsm-default.ini...\c" wget -N /dev/null ${githuburl}/TeamSpeak3/cfg/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq From 8cde21e6dad37bd95638416e3ccea210119de107 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 23 Jul 2016 15:50:47 +0100 Subject: [PATCH 15/36] Updated Links --- README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6d395dafb..79748cc87 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,18 @@ If you want to donate to the project you can via PayPal, Flattr or Gratipay. I h

Useful Links

+

Social

+
    +
  • Steam Group
  • +
  • Discord
  • +
  • Twitter
  • +
  • Facebook
  • +
  • Google+
  • +
      From 2f79f5c56eb11a9a2a21c6c024a9e21e6479da08 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 23 Jul 2016 17:52:21 +0100 Subject: [PATCH 16/36] success to complete success does not exist anymore --- lgsm/functions/check_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 0ea98d6bb..beec79829 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -88,7 +88,7 @@ fn_found_missing_deps(){ fn_print_failure_nl "Unable to install dependencies" fn_script_log_fail "Unable to install dependencies" else - fn_print_success_nl "Install dependencies completed" + fn_print_complete_nl "Install dependencies completed" fn_script_log_pass "Install dependencies completed" fi else From 219cecc3e6724fd5d6ed20a11e1205cc41ef7f01 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 23 Jul 2016 23:12:41 +0100 Subject: [PATCH 17/36] added timeout of 10 seconds Discovered issue with steamCMD sometimes getting stuck for an unknown reason. Causing the update command not to ever finish. I have added a timeout of 10 seconds so should it fail it will quit the updater. --- lgsm/functions/update_steamcmd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 31c022eb3..d2112b877 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -154,7 +154,7 @@ fn_update_steamcmd_check(){ fi # Gets availablebuild info - availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"${branchname}\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) + availablebuild=$(timeout 10s ./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit; sleep 10 | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"${branchname}\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) if [ -z "${availablebuild}" ]; then fn_print_fail "Checking for update: SteamCMD" sleep 1 From d80b38ced5b991571dfb00db55651f2618747972 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 23 Jul 2016 23:37:02 +0100 Subject: [PATCH 18/36] no longer required --- lgsm/functions/install_gsquery.sh | 33 ------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 lgsm/functions/install_gsquery.sh diff --git a/lgsm/functions/install_gsquery.sh b/lgsm/functions/install_gsquery.sh deleted file mode 100644 index 9878537e0..000000000 --- a/lgsm/functions/install_gsquery.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# LGSM install_gsquery.sh function -# Author: Daniel Gibbs -# Website: https://gameservermanagers.com - -local commandname="INSTALL" -local commandaction="Install" -local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" - -fn_dlgsquery(){ - cd "${functionsdir}" - echo -e "downloading gsquery.py...\c" - wget -N /dev/null "https://gameservermanagers.com/dl/gsquery.py" 2>&1 | grep -F "HTTP" | grep -v "Moved Permanently" | cut -c45- | uniq - chmod +x gsquery.py -} - -if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${gamename}" == "Hurtworld" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then - echo "" - echo "GameServerQuery" - echo "=================================" - if [ -z ${autoinstall} ]; then - while true; do - read -e -i "y" -p "Do you want to install GameServerQuery? [Y/n]" yn - case $yn in - [Yy]* ) fn_dlgsquery;break;; - [Nn]* ) echo ""; echo "Not installing GameServerQuery.";break;; - * ) echo "Please answer yes or no.";; - esac - done - else - fn_dlgsquery - fi -fi From 328984588c39736487fe48aba594a95d4734da31 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 24 Jul 2016 01:08:32 +0100 Subject: [PATCH 19/36] timeout causing an issue parsing Reverting for now. However will figure out a way to implement it --- lgsm/functions/update_steamcmd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index d2112b877..9e6a20a8e 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -154,7 +154,7 @@ fn_update_steamcmd_check(){ fi # Gets availablebuild info - availablebuild=$(timeout 10s ./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit; sleep 10 | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"${branchname}\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) + availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit; sleep 10 | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"${branchname}\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) if [ -z "${availablebuild}" ]; then fn_print_fail "Checking for update: SteamCMD" sleep 1 From fd4102c11c5ff079d76822a6bad1bf22f9d54230 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 24 Jul 2016 09:27:12 +0100 Subject: [PATCH 20/36] Revert "added timeout of 10 seconds" This reverts commit 219cecc3e6724fd5d6ed20a11e1205cc41ef7f01. # Conflicts: # lgsm/functions/update_steamcmd.sh --- lgsm/functions/update_steamcmd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 9e6a20a8e..31c022eb3 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -154,7 +154,7 @@ fn_update_steamcmd_check(){ fi # Gets availablebuild info - availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit; sleep 10 | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"${branchname}\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) + availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"${branchname}\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) if [ -z "${availablebuild}" ]; then fn_print_fail "Checking for update: SteamCMD" sleep 1 From a176649c3413a581532b7b4e7acc8750c14dfebc Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 26 Jul 2016 13:05:12 +0200 Subject: [PATCH 21/36] 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 22/36] 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 23/36] 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 24/36] 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 From 002c7a99e4d0dc3e46366f94c7b0c39e39681bfe Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 19:02:10 +0200 Subject: [PATCH 25/36] RCON password check for Rust If no RCON password is set, it completely messes up with Rust. If the default password is set, the admin should be warned as it's quite dangerous. Tested working as expected. --- lgsm/functions/check_config.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh index b42c47d9d..88a298f50 100644 --- a/lgsm/functions/check_config.sh +++ b/lgsm/functions/check_config.sh @@ -17,4 +17,21 @@ if [ ! -e "${servercfgfullpath}" ]; then fn_script_log_warn "${servercfgfullpath}" sleep 2 fi -fi \ No newline at end of file +fi +if [ "${gamename}" == "Rust" ]; then + if [ -z "${rconpassword}" ]; then + fn_print_dots "" + sleep 0.5 + fn_print_warn_nl "RCON password not set!" + echo "This would lead to unexpected behavior. Aborting." + fn_script_log_warn "No RCON Password set, exitting!" + exit 1 + elif [ "${rconpassword}" == "CHANGE_ME" ]; then + fn_print_dots "" + sleep 0.5 + fn_print_warn_nl "Default RCON Password detected!" + echo "Having CHANGE_ME as a passowrd is not very safe." + fn_script_log_warn "RCON Password is the default one!" + sleep 2 + fi +fi From c89500cbacaafda094a40d0a8d553018936f1a61 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 19:56:44 +0200 Subject: [PATCH 26/36] Init RAM requirement check --- lgsm/functions/check_system_requirements.sh | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lgsm/functions/check_system_requirements.sh diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh new file mode 100644 index 000000000..dde47efb0 --- /dev/null +++ b/lgsm/functions/check_system_requirements.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LGSM check_system_requirements.sh +# Author: Daniel Gibbs +# Contributor: UltimateByte +# Website: https://gameservermanagers.com +# Description: Checks RAM requirement + +mbphysmem=$(free -m | awk '/Mem:/ {print $2}') + +# RAM requirement in MegaBytes for each game or engine +if [ "${gamename} == "Rust" ]; then + ramrequirement="4000" +fi + +# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM +if [ -n "${ramrequirement}" ]; then + if [ "${mbphysmem}" -lt "${ramrequirement} ]; then + # Warn the user + fn_print_warn "Insufficient physical RAM: ${mbphysmem}MB available for ${ramrequirement}MB required." + echo "You may encounter issues such as server lagging or shutting down unexpectedly." + fn_script_log_warn "Insufficient physical RAM: ${mbphysmem}MB available for ${ramrequirement}MB required." + fi +fi From 18d94278f1338dfd953ff44c933f758c6c36dbb4 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 20:08:50 +0200 Subject: [PATCH 27/36] Check system requirements --- lgsm/functions/check.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index 95e1a92ba..ac5fb9bc8 100644 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -83,3 +83,11 @@ do check_status.sh fi done + +local allowed_commands_array=( command_install.sh command_start.sh command_debug.sh ) +for allowed_command in "${allowed_commands_array[@]}" +do + if [ "${allowed_command}" == "${function_selfname}" ]; then + check_system_requirements.sh + fi +done From 3e77fc24f699805c2d0be04721a6ccfbff872e57 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 20:10:58 +0200 Subject: [PATCH 28/36] added sleeps --- lgsm/functions/check_system_requirements.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index dde47efb0..cf8e40d00 100644 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -17,7 +17,9 @@ if [ -n "${ramrequirement}" ]; then if [ "${mbphysmem}" -lt "${ramrequirement} ]; then # Warn the user fn_print_warn "Insufficient physical RAM: ${mbphysmem}MB available for ${ramrequirement}MB required." + sleep 2 echo "You may encounter issues such as server lagging or shutting down unexpectedly." + sleep 0.5 fn_script_log_warn "Insufficient physical RAM: ${mbphysmem}MB available for ${ramrequirement}MB required." fi fi From 633372e84b435817cafff8ee5264a8cfc57495b0 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 20:17:18 +0200 Subject: [PATCH 29/36] added function check_system_requirements.sh --- lgsm/functions/core_functions.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index e89b18fe7..ba8e3a241 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -222,6 +222,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } +check_system_requirements.sh(){ +functionfile="${FUNCANME}" +fn_fetch_function +} + check_tmux.sh(){ functionfile="${FUNCNAME}" fn_fetch_function From fc99a2cf30ba27979c1d1394183e7bbb786036dc Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 20:27:03 +0200 Subject: [PATCH 30/36] Missing quotes --- lgsm/functions/check_system_requirements.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index cf8e40d00..5743281e6 100644 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -8,13 +8,13 @@ mbphysmem=$(free -m | awk '/Mem:/ {print $2}') # RAM requirement in MegaBytes for each game or engine -if [ "${gamename} == "Rust" ]; then +if [ "${gamename}" == "Rust" ]; then ramrequirement="4000" fi # If the game or engine has a minimum RAM Requirement, compare it to system's available RAM if [ -n "${ramrequirement}" ]; then - if [ "${mbphysmem}" -lt "${ramrequirement} ]; then + if [ "${mbphysmem}" -lt "${ramrequirement}"" ]; then # Warn the user fn_print_warn "Insufficient physical RAM: ${mbphysmem}MB available for ${ramrequirement}MB required." sleep 2 From 03951aefed981e5b3cf9ed77dcdfe958490943a7 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 20:36:10 +0200 Subject: [PATCH 31/36] FUNCANME > FUNCNAME for fuck sake --- lgsm/functions/core_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index ba8e3a241..2dda20940 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -223,7 +223,7 @@ fn_fetch_function } check_system_requirements.sh(){ -functionfile="${FUNCANME}" +functionfile="${FUNCNAME}" fn_fetch_function } From cce566e8857ba7d396a59caf8f4a578d927c4feb Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 20:37:34 +0200 Subject: [PATCH 32/36] removed damn autoquote --- lgsm/functions/check_system_requirements.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index 5743281e6..5a0409265 100644 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -14,7 +14,7 @@ fi # If the game or engine has a minimum RAM Requirement, compare it to system's available RAM if [ -n "${ramrequirement}" ]; then - if [ "${mbphysmem}" -lt "${ramrequirement}"" ]; then + if [ "${mbphysmem}" -lt "${ramrequirement}" ]; then # Warn the user fn_print_warn "Insufficient physical RAM: ${mbphysmem}MB available for ${ramrequirement}MB required." sleep 2 From 3f52a2f9880c30846038613bf66ad88ded6e5985 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 26 Jul 2016 20:40:04 +0200 Subject: [PATCH 33/36] Line jump --- lgsm/functions/check_system_requirements.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index 5a0409265..53d09a93b 100644 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -18,6 +18,7 @@ if [ -n "${ramrequirement}" ]; then # Warn the user fn_print_warn "Insufficient physical RAM: ${mbphysmem}MB available for ${ramrequirement}MB required." sleep 2 + echo "" echo "You may encounter issues such as server lagging or shutting down unexpectedly." sleep 0.5 fn_script_log_warn "Insufficient physical RAM: ${mbphysmem}MB available for ${ramrequirement}MB required." From f0229868328b05ba8bf65cb7ac32a4a4cad8519d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 27 Jul 2016 22:02:18 +0100 Subject: [PATCH 34/36] Now using core_exit.sh Updated to use new exit code system. I have added a wiki page with the basics https://github.com/dgibbs64/linuxgsm/wiki/LGSM-Exit-Codes Corrected typos --- lgsm/functions/check_config.sh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh index 88a298f50..61d0a8caf 100644 --- a/lgsm/functions/check_config.sh +++ b/lgsm/functions/check_config.sh @@ -18,20 +18,22 @@ if [ ! -e "${servercfgfullpath}" ]; then sleep 2 fi fi + if [ "${gamename}" == "Rust" ]; then - if [ -z "${rconpassword}" ]; then - fn_print_dots "" - sleep 0.5 - fn_print_warn_nl "RCON password not set!" - echo "This would lead to unexpected behavior. Aborting." - fn_script_log_warn "No RCON Password set, exitting!" - exit 1 - elif [ "${rconpassword}" == "CHANGE_ME" ]; then - fn_print_dots "" - sleep 0.5 - fn_print_warn_nl "Default RCON Password detected!" - echo "Having CHANGE_ME as a passowrd is not very safe." - fn_script_log_warn "RCON Password is the default one!" - sleep 2 - fi + if [ -z "${rconpassword}" ]; then + fn_print_dots "" + sleep 0.5 + fn_print_fail_nl "RCON password is not set!" + echo " * Not setting an RCON password causes issues with ${gamename}" + fn_script_log_fatal "RCON password is not set" + fn_script_log_fatal "Not setting an RCON password causes issues with ${gamename}" + core_exit.sh + elif [ "${rconpassword}" == "CHANGE_ME" ]; then + fn_print_dots "" + sleep 0.5 + fn_print_warn_nl "Default RCON Password detected!" + echo " * Having ${rconpassword} as a password is not very safe." + fn_script_log_warn "Default RCON Password detected" + sleep 2 + fi fi From 1ba937212210dbc0c7126d0158538a1f63c757d0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 27 Jul 2016 22:20:09 +0100 Subject: [PATCH 35/36] added physicaltotalmb --- 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 b75499f3d..3e81c1a60 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -61,13 +61,13 @@ else fi physmemtotal=$(free ${humanreadable} | awk '/Mem:/ {print $2}') +physmemtotalmb=$(free -m | awk '/Mem:/ {print $2}') physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}') physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}') swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}') swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}') swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}') - ### Disk Infomation ## Available disk space on the partition. From 0d4df73f17010360258d3938bac4b95cd5fa5f24 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 27 Jul 2016 22:22:01 +0100 Subject: [PATCH 36/36] using info_distro and updated messages --- lgsm/functions/check_system_requirements.sh | 32 +++++++++++---------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index 53d09a93b..d9e56cc5f 100644 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -3,24 +3,26 @@ # Author: Daniel Gibbs # Contributor: UltimateByte # Website: https://gameservermanagers.com -# Description: Checks RAM requirement +# Description: Checks RAM requirements -mbphysmem=$(free -m | awk '/Mem:/ {print $2}') +local commandname="CHECK" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -# RAM requirement in MegaBytes for each game or engine +info_distro.sh + +# RAM requirements in megabytes for each game or engine. if [ "${gamename}" == "Rust" ]; then - ramrequirement="4000" + ramrequirementmb="4000" + ramrequirementgb="4" fi -# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM +# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM. if [ -n "${ramrequirement}" ]; then - if [ "${mbphysmem}" -lt "${ramrequirement}" ]; then - # Warn the user - fn_print_warn "Insufficient physical RAM: ${mbphysmem}MB available for ${ramrequirement}MB required." - sleep 2 - echo "" - echo "You may encounter issues such as server lagging or shutting down unexpectedly." - sleep 0.5 - fn_script_log_warn "Insufficient physical RAM: ${mbphysmem}MB available for ${ramrequirement}MB required." - fi -fi + if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then + # Warn the user + fn_print_warn "Insufficient memory: ${ramrequirementgb}G required, ${physmemtotal} available" + sleep 1 + fn_print_warning "You may experiance poor performance from your server" + sleep 1 + fi +fi