diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index 263c61a37..d236fd9d4 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -40,7 +40,7 @@ ip="0.0.0.0" updateonstart="off" fn_parms(){ - parms="TheIsland?listen?MultiHome=${ip}?SessionName=${servername}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?ServerAdminPassword=${rconpassword}" + parms="TheIsland?listen?MultiHome=${ip}?SessionName=${servername}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?ServerAdminPassword=${rconpassword}" } #### Advanced Variables #### diff --git a/DayOfInfamy/cfg/lgsm-default.cfg b/DayOfInfamy/cfg/lgsm-default.cfg new file mode 100644 index 000000000..364cc1420 --- /dev/null +++ b/DayOfInfamy/cfg/lgsm-default.cfg @@ -0,0 +1,16 @@ +"hostname" "" +"rcon_password" "" +"mapcyclefile" "mapcycle_tactical_operation.txt" // "tactical operation" mapcycle - firefight, vip, search and destroy +"mp_friendlyfire" "1" // friendly fire +"mp_tkpunish" "1" // How to punish team killing ( 0 = none, 1 = warning, 2 = kill ) +"sv_hud_deathmessages" "0" // death messages +"sv_hud_scoreboard_show_kd" "1" // show k:d on scoreboard +"sv_hud_targetindicator" "1" // show friendly player names when looking at them +"mp_timer_pregame" "10" // timer for the pre-game (before the game starts, usually after map change or on mp_restartgame 1) +"mp_timer_preround" "15" // timer for the pre-round (before the round starts, usually after a previous round ends or on mp_restartround 1) +"mp_timer_postround" "15" // timer for the post-round (after the round starts) +"mp_timer_postgame" "21" // timer for the post-game (at the end of a game / map rotation) +"ins_bot_quota" "0" // if set higher than 0, the server will add this many bots to each team +"sv_deadvoice" "0" // enabling this will allow the dead and living to VOIP each other +"sv_deadchat" "0" // enabling this will allow the dead and living to chat text each other +"sv_deadchat_team" "1" // is deadchat limited to just your team? diff --git a/DayOfInfamy/doiserver b/DayOfInfamy/doiserver new file mode 100644 index 000000000..1f313d0c7 --- /dev/null +++ b/DayOfInfamy/doiserver @@ -0,0 +1,157 @@ +#!/bin/bash +# Day of Infamy +# Server Management Script +# Author: Daniel Gibbs +# Website: https://gameservermanagers.com +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x +fi + +version="210516" + +#### Variables #### + +# Notification Alerts +# (on|off) + +# Email +emailalert="off" +email="email@example.com" + +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + +# Steam login +steamuser="anonymous" +steampass="" + +# Start Variables +defaultmap="bastogne" +maxplayers="16" +tickrate="64" +port="27015" +sourcetvport="27020" +clientport="27005" +ip="0.0.0.0" +updateonstart="off" +workshop="0" + +# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server +fn_parms(){ +parms="-game doi -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers} +sv_workshop_enabled ${workshop}" +} + +#### Advanced Variables #### + +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + +# Steam +appid="462310" + +# Server Details +servicename="doi-server" +gamename="Day of Infamy" +engine="source" + +# Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" +filesdir="${rootdir}/serverfiles" +systemdir="${filesdir}/doi" +executabledir="${filesdir}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/lgsm-default.cfg" +backupdir="${rootdir}/backups" + +# Logging +logdays="7" +gamelogdir="${systemdir}/logs" +scriptlogdir="${rootdir}/log/script" +consolelogdir="${rootdir}/log/console" +consolelogging="on" + +scriptlog="${scriptlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +emaillog="${scriptlogdir}/${servicename}-email.log" + +scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" + +##### Script ##### +# Do not edit + +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir -p "${filedir}" + fi + echo -e " fetching ${filename}...\c" + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit 1 + fi + chmod +x "${filedir}/${filename}" +fi +source "${filedir}/${filename}" +} + +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl +} + +core_functions.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl +} + +core_dl.sh +core_functions.sh + +getopt=$1 +core_getopt.sh \ No newline at end of file diff --git a/ProjectZomboid/cfg/lgsm-default.ini b/ProjectZomboid/cfg/lgsm-default.ini index df25258ab..5ca4fe917 100644 --- a/ProjectZomboid/cfg/lgsm-default.ini +++ b/ProjectZomboid/cfg/lgsm-default.ini @@ -14,10 +14,8 @@ SafetyToggleTimer=100 SafetyCooldownTimer=120 SpawnItems= DefaultPort=16261 -ResetID=834499345 Mods= Map=Muldraugh, KY -SpawnRegions=servertest_spawnregions.lua DoLuaChecksum=true Public=false PublicName=pzserver @@ -33,7 +31,7 @@ NoFireSpread=false NoFire=false AnnounceDeath=false MinutesPerPage=1.0 -HoursForCorpseRemoval=0 +HoursForCorpseRemoval=0.0 SaveWorldEveryMinutes=0 PlayerSafehouse=false AdminSafehouse=false @@ -44,3 +42,25 @@ SafehouseAllowRespawn=false SafehouseDaySurvivedToClaim=0 SafeHouseRemovalTime=144 AllowDestructionBySledgehammer=true +KickFastPlayers=false +RCONPort=27015 +RCONPassword= +Password= +MaxAccountsPerUser=0 +SleepAllowed=false +SleepNeeded=false +SteamPort1=8766 +SteamPort2=8767 +WorkshopItems= +SteamScoreboard=true +SteamVAC=true +UPnP=true +UPnPLeaseTime=86400 +UPnPZeroLeaseTimeFallback=true +UPnPForce=true +CoopServerLaunchTimeout=20 +CoopMasterPingTimeout=60 +server_browser_announced_ip= +UseTCPForMapDownloads=false +PlayerRespawnWithSelf=false +PlayerRespawnWithOther=false \ No newline at end of file diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver index 98d855ac6..7cb225c8b 100644 --- a/ProjectZomboid/pzserver +++ b/ProjectZomboid/pzserver @@ -10,7 +10,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="210516" +version="290716" #### Variables #### @@ -31,11 +31,12 @@ steamuser="anonymous" steampass="" # Start Variables +adminpassword="CHANGE_ME" ip="0.0.0.0" updateonstart="off" fn_parms(){ -parms="" +parms="-ip ${ip} -adminpassword \"${adminpassword}\"" } #### Advanced Variables #### diff --git a/TeamSpeak3/ts3server b/TeamSpeak3/ts3server index 7a6491bff..247d80191 100644 --- a/TeamSpeak3/ts3server +++ b/TeamSpeak3/ts3server @@ -1,5 +1,5 @@ #!/bin/bash -# Teamspeak 3 +# TeamSpeak 3 # Server Management Script # Author: Daniel Gibbs # Website: https://gameservermanagers.com @@ -9,7 +9,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="210516" +version="290716" #### Variables #### @@ -29,8 +29,8 @@ pushbullettoken="accesstoken" updateonstart="off" # Server Details -gamename="Teamspeak 3" -servername="Teamspeak 3 Server" +gamename="TeamSpeak 3" +servername="TeamSpeak 3 Server" servicename="ts3-server" # Directories diff --git a/Teeworlds/cfg/tdm.cfg b/Teeworlds/cfg/tdm.cfg index c2ab04326..4cde3cd33 100644 --- a/Teeworlds/cfg/tdm.cfg +++ b/Teeworlds/cfg/tdm.cfg @@ -1,6 +1,6 @@ // **************************************************************************** // * -// TeeWorlds - tdm.cfg * +// Teeworlds - tdm.cfg * // Version 281015 * // * // **************************************************************************** diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 206abba22..5aaf3103e 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -28,7 +28,7 @@ fn_alert_restart_query(){ fn_alert_update(){ fn_script_log_info "Sending update alert" alertsubject="LGSM - Updated - ${servername}" - alertbody="${servicename} recieved update" + alertbody="${servicename} received update" } if [ "${alert}" == "restart" ]; then diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh index e0d84b255..a89ef4967 100644 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/functions/alert_email.sh @@ -2,7 +2,7 @@ # LGSM alert_email.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Sends email alert if monitor picks up a failure. +# Description: Sends email alert including server details and logs. local commandname="ALERT" local commandaction="Alert" @@ -153,7 +153,7 @@ fn_details_gameserver(){ echo -e "Tick rate: ${tickrate}" fi - # Teamspeak dbplugin + # TeamSpeak dbplugin if [ -n "${dbplugin}" ]; then echo -e "dbplugin: ${dbplugin}" fi diff --git a/lgsm/functions/alert_pushbullet.sh b/lgsm/functions/alert_pushbullet.sh index e8e65c607..221701a7d 100644 --- a/lgsm/functions/alert_pushbullet.sh +++ b/lgsm/functions/alert_pushbullet.sh @@ -2,7 +2,7 @@ # LGSM alert_pushbullet.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: alerts using pushbullet. +# Description: Sends Pushbullet alert including the server status. local commandname="ALERT" local commandaction="Alert" diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index ac5fb9bc8..2620af6fc 100644 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -2,7 +2,6 @@ # LGSM check.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com - # Description: Overall function for managing checks. # Runs checks that will either halt on or fix an issue. @@ -63,7 +62,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 diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh index 61d0a8caf..9ad4c7baa 100644 --- a/lgsm/functions/check_config.sh +++ b/lgsm/functions/check_config.sh @@ -2,7 +2,7 @@ # LGSM check_config.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: If server config missing warn user. +# Description: Checks if the server config is missing and warns the user if needed. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index beec79829..6b43262ef 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -2,7 +2,7 @@ # LGSM check_deps.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Checks that the requires dependencies are installed for LGSM. +# Description: Checks if required dependencies are installed for LGSM. local commandname="CHECK" @@ -163,6 +163,7 @@ if [ -n "$(command -v dpkg-query)" ]; then # Brainbread 2 and Don't Starve Together elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then array_deps_required+=( libcurl4-gnutls-dev:i386 ) + # Project Zomboid elif [ "${engine}" == "projectzomboid" ]; then array_deps_required+=( openjdk-7-jre ) # Unreal engine @@ -209,6 +210,7 @@ elif [ -n "$(command -v yum)" ]; then # Brainbread 2 and Don't Starve Together elif [ "${gamename}" == "Brainbread 2" ]||[ "${gamename}" == "Don't Starve Together" ]; then array_deps_required+=( libcurl.i686 ) + # Project Zomboid elif [ "${engine}" == "projectzomboid" ]; then array_deps_required+=( java-1.7.0-openjdk ) # Unreal engine diff --git a/lgsm/functions/check_glibc.sh b/lgsm/functions/check_glibc.sh index 8b0fe339c..2fcd6e8a1 100644 --- a/lgsm/functions/check_glibc.sh +++ b/lgsm/functions/check_glibc.sh @@ -2,7 +2,7 @@ # LGSM check_glibc.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Checks if server has correct glibc or has a fix available. +# Description: Checks if the server has the correct Glibc version or a fix available. local commandname="CHECK" diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index 5375bcac6..9d09042ab 100644 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -3,12 +3,12 @@ # Author: Daniel Gibbs # Website: https://gameservermanagers.com # Description: Automatically identifies the server interface IP. -# If multiple interfaces are detected the user will need to manualy set using ip="0.0.0.0". +# If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0". local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -if [ "${gamename}" != "Teamspeak 3" ]; then +if [ "${gamename}" != "TeamSpeak 3" ]; then if [ ! -f "/bin/ip" ]; then ipcommand="/sbin/ip" else diff --git a/lgsm/functions/check_logs.sh b/lgsm/functions/check_logs.sh index 3012203fb..5bd69bb0f 100644 --- a/lgsm/functions/check_logs.sh +++ b/lgsm/functions/check_logs.sh @@ -2,13 +2,13 @@ # LGSM check_logs.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Checks that log files exist on server start +# Description: Checks if log files exist. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -# Create dir's for the script and console logs -if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "Teamspeak 3" ]; then +# Create directories for the script and console logs +if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "TeamSpeak 3" ]; then fn_print_dots "Checking for log files" sleep 0.5 fn_print_info_nl "Checking for log files: Creating log files" diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index 2eb312312..c95a76479 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributor: UltimateByte # Website: https://gameservermanagers.com -# Description: Checks script, files and folders ownership and permissions. +# Description: Checks ownership & permissions of scripts, files and folders. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh index 903075c29..70067f5e5 100644 --- a/lgsm/functions/check_root.sh +++ b/lgsm/functions/check_root.sh @@ -2,6 +2,7 @@ # LGSM check_root.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Checks if the user tried to run the script as root. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh index 7f6944e1e..f68fd9a52 100644 --- a/lgsm/functions/check_status.sh +++ b/lgsm/functions/check_status.sh @@ -3,12 +3,12 @@ # Author: Daniel Gibbs # Contributor: UltimateByte # Website: https://gameservermanagers.com -# Description: Checks the proccess status of the server. Either online or offline. +# Description: Checks the process status of the server. Either online or offline. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -if [ "${gamename}" == "Teamspeak 3" ]; then +if [ "${gamename}" == "TeamSpeak 3" ]; then # 1: Server is running # 0: Server seems to have died # 0: No server running (ts3server.pid is missing) diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/functions/check_steamcmd.sh index 44fe50e4f..01da9cda2 100644 --- a/lgsm/functions/check_steamcmd.sh +++ b/lgsm/functions/check_steamcmd.sh @@ -2,7 +2,7 @@ # LGSM check_steamcmd.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Checks SteamCMD is installed and correct. +# Description: Checks if SteamCMD is installed correctly. local commandname="CHECK" @@ -15,9 +15,8 @@ fn_install_steamcmd(){ chmod +x "${steamcmddir}/steamcmd.sh" } - fn_check_steamcmd_user(){ - # Checks steamuser is setup. + # Checks if steamuser is setup. if [ "${steamuser}" == "username" ]; then fn_print_fail_nl "Steam login not set. Update steamuser in ${selfname}." echo " * Change steamuser=\"username\" to a valid steam login." @@ -59,7 +58,7 @@ fn_check_steamcmd_sh(){ fn_check_steamcmd_guard(){ if [ "${function_selfname}" == "command_update.sh" ]||[ "${function_selfname}" == "command_validate.sh" ]; then - # Checks that steamcmd is working correctly and will prompt Steam Guard if required. + # Checks that SteamCMD is working correctly and will prompt Steam Guard if required. "${steamcmddir}"/steamcmd.sh +login "${steamuser}" "${steampass}" +quit if [ $? -ne 0 ]; then fn_print_failure_nl "Error running SteamCMD" @@ -69,5 +68,5 @@ fn_check_steamcmd_guard(){ fn_check_steamcmd_user fn_check_steamcmd_sh -# stdbuf has now replaced unbuffer. This shoudl no longer be required +# stdbuf has now replaced unbuffer. This should not longer be required. #fn_check_steamcmd_guard \ No newline at end of file diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/functions/check_system_dir.sh index 9c6448ca1..d06cbba05 100644 --- a/lgsm/functions/check_system_dir.sh +++ b/lgsm/functions/check_system_dir.sh @@ -2,6 +2,7 @@ # LGSM check_system_dir.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Checks if systemdir is accessible. local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index a83defc3d..260cd91fb 100644 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -2,7 +2,7 @@ # LGSM command_debug.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Runs the server without tmux. Runs direct from the terminal. +# Description: Runs the server without tmux and directly from the terminal. local commandname="DEBUG" local commandaction="Debug" diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index c53410353..44000b3d1 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -44,7 +44,7 @@ fn_details_performance(){ # Avg Load: 1.00, 1.01, 0.78 # # Mem: total used free cached - # Physical: 741M 656M 85M 256M + # Physical: 741M 656M 85M 256M # Swap: 0B 0B 0B echo -e "" @@ -151,7 +151,7 @@ fn_details_gameserver(){ echo -e "${blue}Tick rate:\t${default}${tickrate}" fi - # Teamspeak dbplugin + # TeamSpeak dbplugin if [ -n "${dbplugin}" ]; then echo -e "${blue}dbplugin:\t${default}${dbplugin}" fi @@ -287,7 +287,7 @@ fn_details_ports(){ echo -e "Change ports by editing the parameters in:" parmslocation="${red}UNKNOWN${default}" - local ports_edit_array=( "avalanche" "dontstarve" "projectzomboid" "idtech3" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "Teamspeak 3" "Mumble" "7 Days To Die" ) + local ports_edit_array=( "avalanche" "dontstarve" "projectzomboid" "idtech3" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "TeamSpeak 3" "Mumble" "7 Days To Die" ) for port_edit in "${ports_edit_array[@]}" do if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then @@ -580,7 +580,7 @@ fn_details_gameserver fn_details_script fn_details_backup # Some game servers do not have parms. -if [ "${gamename}" != "Teamspeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then +if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then fn_parms fn_details_commandlineparms fi @@ -617,7 +617,7 @@ elif [ "${gamename}" == "Hurtworld" ]; then fn_details_hurtworld elif [ "${gamename}" == "7 Days To Die" ]; then fn_details_sdtd -elif [ "${gamename}" == "Teamspeak 3" ]; then +elif [ "${gamename}" == "TeamSpeak 3" ]; then fn_details_teamspeak3 elif [ "${gamename}" == "Mumble" ]; then fn_details_mumble diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/functions/command_dev_debug.sh index bfaa86f18..6186c0fb0 100644 --- a/lgsm/functions/command_dev_debug.sh +++ b/lgsm/functions/command_dev_debug.sh @@ -2,7 +2,7 @@ # LGSM command_dev_debug.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Dev only: enables debuging log to be saved to dev-debug.log. +# Description: Dev only: Enables debugging log to be saved to dev-debug.log. local commandname="DEV-DEBUG" local commandaction="Dev-Debug" diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index ac0cd0fa6..a0bb581e7 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributor: UltimateByte # Website: https://gameservermanagers.com -# Description: Creates a FastDL folder +# Description: Creates a FastDL folder. local commandname="FASTDL" local commandaction="FastDL" diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index a7bdd4d1f..ac66e96e4 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -18,7 +18,7 @@ check_deps.sh if [ "${gamename}" == "Unreal Tournament 2004" ]; then install_server_files.sh install_ut2k4_key.sh -elif [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Teamspeak 3" ]||[ "${gamename}" == "Mumble" ]; then +elif [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]; then installer=1 install_server_files.sh elif [ -n "${appid}" ]; then @@ -30,7 +30,7 @@ fi install_config.sh if [ "${gamename}" == "Counter Strike: Global Offensive" ]||[ "${gamename}" == "Team Fortress 2" ]||[ "${gamename}" == "BrainBread 2" ]; then install_gslt.sh -elif [ "${gamename}" == "Teamspeak 3" ]; then +elif [ "${gamename}" == "TeamSpeak 3" ]; then install_ts3db.sh fi diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 5496d7e1d..0d9a916c1 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributor: UltimateByte # Website: https://gameservermanagers.com -# Description: Monitors server by checking for running proccesses +# Description: Monitors server by checking for running processes. # then passes to monitor_gsquery.sh. local commandname="MONITOR" @@ -108,7 +108,7 @@ info_config.sh fn_monitor_check_lockfile fn_monitor_check_update fn_monitor_msg_checking -if [ "${gamename}" == "Teamspeak 3" ]; then +if [ "${gamename}" == "TeamSpeak 3" ]; then fn_monitor_teamspeak3 elif [ "${gamename}" == "Mumble" ]; then fn_monitor_mumble diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh index 9e1a2142f..eacebaaea 100644 --- a/lgsm/functions/command_restart.sh +++ b/lgsm/functions/command_restart.sh @@ -1,8 +1,8 @@ #!/bin/bash -# LGSM command_start.sh function +# LGSM command_restart.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Starts the server. +# Description: Restarts the server. local commandname="RESTART" local commandaction="Restarting" diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index c39456268..f7f324bf1 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -178,7 +178,7 @@ if [ "${status}" == "0" ]; then fi fi -if [ "${gamename}" == "Teamspeak 3" ]; then +if [ "${gamename}" == "TeamSpeak 3" ]; then fn_start_teamspeak3 else fn_start_tmux diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index ccb350c12..572225c18 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -257,8 +257,8 @@ fn_stop_tmux(){ # checks if the server is already stopped before trying to stop. fn_stop_pre_check(){ - check_status.sh - if [ "${gamename}" == "Teamspeak 3" ]; then + if [ "${gamename}" == "TeamSpeak 3" ]; then + check_status.sh if [ "${status}" == "0" ]; then fn_print_info_nl "${servername} is already stopped" fn_script_log_error "${servername} is already stopped" diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh index 3f66c6400..2f9749200 100644 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/functions/command_test_alert.sh @@ -2,7 +2,7 @@ # LGSM command_test_alert.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Sends a test email alert. +# Description: Sends a test alert. local commandname="ALERT" local commandaction="Alert" diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh index bc65de444..e260b8a2a 100644 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributor : UltimateByte # Website: https://gameservermanagers.com -# Description: Changes TS3 serveradmin password +# Description: Changes TS3 serveradmin password. local commandname="TS3-CHANGE-PASS" local commandaction="TS3 Change Password" diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index 83a797f7d..d282cc432 100644 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -13,7 +13,7 @@ sleep 0.5 check.sh -if [ "${gamename}" == "Teamspeak 3" ]; then +if [ "${gamename}" == "TeamSpeak 3" ]; then update_ts3.sh elif [ "${gamename}" == "Mumble" ]; then update_mumble.sh diff --git a/lgsm/functions/command_update_functions.sh b/lgsm/functions/command_update_functions.sh index 0c9c7b803..538a8dee8 100644 --- a/lgsm/functions/command_update_functions.sh +++ b/lgsm/functions/command_update_functions.sh @@ -13,7 +13,7 @@ check.sh fn_script_log_info "Updating functions" echo -ne "\n" -# Removed legecy functions dir +# Removed legacy functions dir if [ -n "${rootdir}" ]; then if [ -d "${rootdir}/functions/" ]; then rm -rfv "${rootdir}/functions/" @@ -26,7 +26,7 @@ if [ -n "${functionsdir}" ]; then cd "${functionsdir}" for functionfile in * do - # Check curl exists and use available path + # Check if curl exists and use available path curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" for curlcmd in ${curlpaths} do diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh index 2054396ce..3bd03e720 100644 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/functions/command_validate.sh @@ -19,7 +19,7 @@ fn_validation(){ cd "${rootdir}/steamcmd" - if [ $(command -v stdbuf) ]; then + if [ $(command -v stdbuf) ]; then unbuffer="stdbuf -i0 -o0 -e0" fi @@ -47,11 +47,11 @@ check.sh check_status.sh if [ "${status}" != "0" ]; then exitbypass=1 - command_stop.sh - fn_validation - exitbypass=1 - command_start.sh + command_stop.sh + fn_validation + exitbypass=1 + command_start.sh else - fn_validation + fn_validation fi core_exit.sh \ No newline at end of file diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/functions/compress_unreal2_maps.sh index 0b42b883e..67d3621e2 100644 --- a/lgsm/functions/compress_unreal2_maps.sh +++ b/lgsm/functions/compress_unreal2_maps.sh @@ -2,7 +2,7 @@ # LGSM compress_unreal2_maps.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: compresses unreal maps +# Description: Compresses unreal maps. local commandaction="Unreal Map Compressor" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/functions/compress_ut99_maps.sh index 899b597d5..3ef6e140e 100644 --- a/lgsm/functions/compress_ut99_maps.sh +++ b/lgsm/functions/compress_ut99_maps.sh @@ -2,7 +2,7 @@ # LGSM compress_ut99_maps.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: compresses unreal maps +# Description: Compresses unreal maps. local commandaction="Unreal Map Compressor" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh index 13f4a5cc5..71580ae4f 100644 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -2,7 +2,7 @@ # LGSM core_exit.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: handles exiting of LGSM by running and reporting an exit code. +# Description: Handles exiting of LGSM by running and reporting an exit code. fn_exit_dev_debug(){ if [ -f "${rootdir}/.dev-debug" ]; then diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 059fc93bd..b9043a6d1 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -5,8 +5,12 @@ # Description: Defines all functions to allow download and execution of functions using fn_fetch_function. # This function is called first before any other function. Without this file other functions will not load. -# Code/functions for legacy servers +# Fix for TeamSpeak 3 scripts using gamename="Teamspeak 3" +if [ "${gamename}" == "Teamspeak 3" ]; then + gamename="TeamSpeak 3" +fi +# Code/functions for legacy servers fn_functions(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -17,8 +21,7 @@ functionfile="${FUNCNAME}" fn_fetch_function } - -# fn_fetch_core_dl also placed here to allow legecy servers to still download core functions +# fn_fetch_core_dl also placed here to allow legacy servers to still download core functions if [ -z "${lgsmdir}" ]; then lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index d3cee3b1f..47cfbf1a7 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -87,7 +87,7 @@ case "${getopt}" in command_update_functions.sh;; m|monitor) command_monitor.sh;; - et|test-alert) + ta|test-alert) command_test_alert.sh;; dt|details) command_details.sh;; @@ -144,7 +144,7 @@ case "${getopt}" in command_update_functions.sh;; m|monitor) command_monitor.sh;; - et|test-alert) + ta|test-alert) command_test_alert.sh;; dt|details) command_details.sh;; @@ -200,7 +200,7 @@ case "${getopt}" in command_validate.sh;; m|monitor) command_monitor.sh;; - et|test-alert) + ta|test-alert) command_test_alert.sh;; dt|details) command_details.sh;; @@ -263,7 +263,7 @@ case "${getopt}" in command_update_functions.sh;; m|monitor) command_monitor.sh;; - et|test-alert) + ta|test-alert) command_test_alert.sh;; dt|details) command_details.sh;; @@ -331,7 +331,7 @@ case "${getopt}" in command_validate.sh;; m|monitor) command_monitor.sh;; - et|test-alert) + ta|test-alert) command_test_alert.sh;; dt|details) command_details.sh;; @@ -395,7 +395,7 @@ case "${getopt}" in command_update_functions.sh;; m|monitor) command_monitor.sh;; - et|test-alert) + ta|test-alert) command_test_alert.sh;; dt|details) command_details.sh;; @@ -448,7 +448,7 @@ case "${getopt}" in if [ "${gamename}" == "Mumble" ]; then fn_getopt_mumble -elif [ "${gamename}" == "Teamspeak 3" ]; then +elif [ "${gamename}" == "TeamSpeak 3" ]; then fn_getopt_teamspeak3 elif [ "${gamename}" == "Garry's Mod" ]; then fn_getopt_gmodserver diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 2118843c6..97f609f50 100644 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -25,59 +25,71 @@ fi ########## ## Feb 28 14:56:58 ut99-server: Monitor: fn_script_log(){ - 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}" + if [ -d "${scriptlogdir}" ]; then + 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 fi } ## Feb 28 14:56:58 ut99-server: Monitor: PASS: fn_script_log_pass(){ - 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}" + if [ -d "${scriptlogdir}" ]; then + 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 fi exitcode=0 } ## Feb 28 14:56:58 ut99-server: Monitor: FATAL: fn_script_log_fatal(){ - 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}" + if [ -d "${scriptlogdir}" ]; then + 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 fi exitcode=1 } ## Feb 28 14:56:58 ut99-server: Monitor: ERROR: fn_script_log_error(){ - 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}" + if [ -d "${scriptlogdir}" ]; then + 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 fi exitcode=2 } ## Feb 28 14:56:58 ut99-server: Monitor: WARN: fn_script_log_warn(){ - 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}" + if [ -d "${scriptlogdir}" ]; then + 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 fi exitcode=3 } ## Feb 28 14:56:58 ut99-server: Monitor: INFO: fn_script_log_info(){ - 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}" + if [ -d "${scriptlogdir}" ]; then + 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 fi } diff --git a/lgsm/functions/core_trap.sh b/lgsm/functions/core_trap.sh index e53236410..46615cfe5 100644 --- a/lgsm/functions/core_trap.sh +++ b/lgsm/functions/core_trap.sh @@ -2,12 +2,12 @@ # LGSM core_trap.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: handles ctrl-C trap to give an exitcode. +# Description: Handles CTRL-C trap to give an exit code. fn_exit_trap(){ echo "" core_exit.sh } -# trap to give an exitcode. +# trap to give an exit code. trap fn_exit_trap INT \ No newline at end of file diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 6a69bd759..7f27d886c 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -45,7 +45,7 @@ if [ "${function_selfname}" != "command_install.sh" ]; then fix_arma3.sh fi - if [ "${gamename}" != "Teamspeak 3" ]; then + if [ "${gamename}" != "TeamSpeak 3" ]; then fix_glibc.sh fi fi diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/functions/fix_csgo.sh index a98d9e17e..38d169532 100644 --- a/lgsm/functions/fix_csgo.sh +++ b/lgsm/functions/fix_csgo.sh @@ -2,7 +2,7 @@ # LGSM fix_csgo.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Resolves various issues with csgo. +# Description: Resolves various issues with CS:GO. local commandname="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fix_dst.sh b/lgsm/functions/fix_dst.sh index 2ffb0a354..fea58b67e 100644 --- a/lgsm/functions/fix_dst.sh +++ b/lgsm/functions/fix_dst.sh @@ -2,7 +2,7 @@ # LGSM fix_dst.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Resolves various issues with Dont Starve together. +# Description: Resolves various issues with Don't Starve Together. local commandname="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fix_glibc.sh b/lgsm/functions/fix_glibc.sh index f9606bdc9..0a4859fc3 100644 --- a/lgsm/functions/fix_glibc.sh +++ b/lgsm/functions/fix_glibc.sh @@ -2,7 +2,7 @@ # LGSM fix_glibc.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Downloads required glibc files and applys teh glibc fix if required +# Description: Downloads required Glibc files and applies the Glibc fix if required. local commandname="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index c4d023ee6..9f08fd36a 100644 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -2,7 +2,7 @@ # LGSM fix_steamcmd.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: Resolves various issues related to steamCMD. +# Description: Resolves various issues related to SteamCMD. local commandname="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fn_functions b/lgsm/functions/fn_functions index ee9891cb6..0d024beb1 100644 --- a/lgsm/functions/fn_functions +++ b/lgsm/functions/fn_functions @@ -4,7 +4,7 @@ # Website: https://gameservermanagers.com lgsm_version="210516" -# Description: Redirect to new core_functions.sh +# Description: Redirects to new core_functions.sh core_functions.sh(){ # Functions are defined in core_functions.sh. diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 79ddd6d2f..139dadc13 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -71,17 +71,26 @@ fn_info_config_dontstarve(){ fn_info_config_projectzomboid(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" slots="${zero}" port="${zero}" + gameworld="${unavailable}" else - servername=$(grep "PublicName=" "${servercfgfullpath}" | sed 's/PublicName=//g' | tr -d '=", \n') + servername=$(grep "PublicName=" "${servercfgfullpath}" | sed 's/PublicName=//g' | tr -d '\') + serverpassword=$(grep "^Password=$" "${servercfgfullpath}" | sed 's/Password=//g' | tr -d '\') + rconpassword=$(grep "RCONPassword=" "${servercfgfullpath}" | sed 's/RCONPassword=//g' | tr -d '\') slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') port=$(grep "DefaultPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + gameworld=$(grep "Map=" "${servercfgfullpath}" | sed 's/Map=//g' | tr -d '\n') # Not Set servername=${servername:-"NOT SET"} - slots=${slots:-"0"} - port=${port:-"0"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + slots=${slots:-"NOT SET"} + port=${port:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} fi } @@ -386,8 +395,8 @@ elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then # Starbound elif [ "${engine}" == "starbound" ]; then fn_info_config_starbound -#TeamSpeak -elif [ "${gamename}" == "Teamspeak 3" ]; then +# TeamSpeak 3 +elif [ "${gamename}" == "TeamSpeak 3" ]; then fn_info_config_teamspeak3 elif [ "${gamename}" == "Mumble" ]; then fn_info_config_mumble diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh index ea4c3a279..cb1cb3c31 100644 --- a/lgsm/functions/info_glibc.sh +++ b/lgsm/functions/info_glibc.sh @@ -2,7 +2,7 @@ # LGSM info_glibc.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: stores details on servers Glibc requirements. +# Description: Stores details on servers Glibc requirements. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" @@ -68,7 +68,7 @@ elif [ "${engine}" == "unreal4" ]; then elif [ "${engine}" == "unity3d" ]; then glibcrequired="2.15" glibcfix="no" -elif [ "${gamename}" == "Teamspeak 3" ]; then +elif [ "${gamename}" == "TeamSpeak 3" ]; then glibcrequired="NOT REQUIRED" glibcfix="no" elif [ "${gamename}" == "Mumble" ]; then diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index 070a52260..81aa3c676 100644 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -143,6 +143,7 @@ elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then # Teeworlds elif [ "${engine}" == "teeworlds" ]; then fn_info_config_teeworlds +# Terraria elif [ "${engine}" == "terraria" ]; then fn_info_config_terraria # Unreal/Unreal 2 engine diff --git a/lgsm/functions/install_complete.sh b/lgsm/functions/install_complete.sh index a0680bcda..af522d2ee 100644 --- a/lgsm/functions/install_complete.sh +++ b/lgsm/functions/install_complete.sh @@ -2,6 +2,7 @@ # LGSM install_complete.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Prints installation completion message and hints. local commandname="INSTALL" local commandaction="Install" diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 7e0438b6b..281ddb87f 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -2,6 +2,7 @@ # LGSM install_config.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Creates default server configs. local commandname="INSTALL" local commandaction="Install" @@ -239,6 +240,11 @@ elif [ "${gamename}" == "Day of Defeat: Source" ]; then wget -N /dev/null ${githuburl}/DayOfDefeatSource/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq sleep 1 fn_sourceconfig +elif [ "${gamename}" == "Day of Infamy" ]; then + echo -e "downloading lgsm-default.cfg...\c" + wget -N /dev/null ${githuburl}/DayOfInfamy/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq + sleep 1 + fn_sourceconfig elif [ "${gamename}" == "Don't Starve Together" ]; then echo -e "downloading lgsm-default.ini...\c" wget -N /dev/null ${githuburl}/DontStarveTogether/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq @@ -341,7 +347,7 @@ elif [ "${gamename}" == "Starbound" ]; then sleep 1 fn_defaultconfig fn_userinputconfig -elif [ "${gamename}" == "Teamspeak 3" ]; then +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 sleep 1 diff --git a/lgsm/functions/install_header.sh b/lgsm/functions/install_header.sh index 3f2e5f0e1..499d1aec9 100644 --- a/lgsm/functions/install_header.sh +++ b/lgsm/functions/install_header.sh @@ -2,6 +2,7 @@ # LGSM install_header.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Prints installation header. local commandname="INSTALL" local commandaction="Install" diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh index 59446681a..abad81329 100644 --- a/lgsm/functions/install_logs.sh +++ b/lgsm/functions/install_logs.sh @@ -2,6 +2,7 @@ # LGSM install_logs.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Creates log directories. local commandname="INSTALL" local commandaction="Install" @@ -22,8 +23,8 @@ if [ -n "${consolelogdir}" ]; then touch "${consolelog}" fi -# If a server is source or goldsource, Teamspeak 3, Starbound, Project Zomhoid create a symbolic link to the game server logs. -if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${gamename}" == "Teamspeak 3" ]||[ "${engine}" == "starbound" ]||[ "${engine}" == "projectzomboid" ]||[ "${engine}" == "unreal" ]; then +# If a server is source or goldsource, TeamSpeak 3, Starbound, Project Zomhoid create a symbolic link to the game server logs. +if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${engine}" == "starbound" ]||[ "${engine}" == "projectzomboid" ]||[ "${engine}" == "unreal" ]; then if [ ! -h "${rootdir}/log/server" ]; then ln -nfsv "${gamelogdir}" "${rootdir}/log/server" fi diff --git a/lgsm/functions/install_retry.sh b/lgsm/functions/install_retry.sh index 661b57f39..d0ca16fef 100644 --- a/lgsm/functions/install_retry.sh +++ b/lgsm/functions/install_retry.sh @@ -2,6 +2,7 @@ # LGSM install_retry.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Asks for installation retry after failure. local commandname="INSTALL" local commandaction="Install" diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh index 2ac93d2fb..d527b6193 100644 --- a/lgsm/functions/install_server_dir.sh +++ b/lgsm/functions/install_server_dir.sh @@ -2,6 +2,7 @@ # LGSM install_server_dir.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Creates the server directory. local commandname="INSTALL" local commandaction="Install" diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index c1f1b9f07..946b1c6d9 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -2,6 +2,7 @@ # LGSM install_server_files.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Installs server files. local commandname="INSTALL" local commandaction="Install" @@ -46,8 +47,8 @@ fn_install_server_files_steamcmd(){ fi # Detects if unbuffer command is available. - if [ $(command -v stdbuf) ]; then - unbuffer="stdbuf -i0 -o0 -e0" + if [ $(command -v stdbuf) ]; then + unbuffer="stdbuf -i0 -o0 -e0" fi if [ "${counter}" -le "4" ]; then @@ -92,7 +93,7 @@ echo "Installing ${gamename} Server" echo "=================================" sleep 1 -if [ "${gamename}" == "Teamspeak 3" ]; then +if [ "${gamename}" == "TeamSpeak 3" ]; then update_ts3.sh elif [ "${gamename}" == "Mumble" ]; then update_mumble.sh diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index 90006538f..bada12c0b 100644 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -3,6 +3,7 @@ # Author: Daniel Gibbs # Contributor: PhilPhonic # Website: https://gameservermanagers.com +# Description: Installs the database server MariaDB for TeamSpeak 3. local commandname="INSTALL" local commandaction="Install" diff --git a/lgsm/functions/install_ut2k4_key.sh b/lgsm/functions/install_ut2k4_key.sh index ba2a7634e..b091faff3 100644 --- a/lgsm/functions/install_ut2k4_key.sh +++ b/lgsm/functions/install_ut2k4_key.sh @@ -2,6 +2,7 @@ # LGSM install_ut2k4_key.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com +# Description: Activates ut2k4 server with given key. local commandname="INSTALL" local commandaction="Install" diff --git a/lgsm/functions/monitor_gsquery.sh b/lgsm/functions/monitor_gsquery.sh index c28bed3bb..02ce17ab4 100644 --- a/lgsm/functions/monitor_gsquery.sh +++ b/lgsm/functions/monitor_gsquery.sh @@ -2,14 +2,14 @@ # LGSM monitor_gsquery.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description: uses gsquery.py to query the server port. -# Detects if the server has frozen with the proccess still running. +# Description: Uses gsquery.py to query the server port. +# Detects if the server has frozen with the process still running. local commandname="MONITOR" local commandaction="Monitor" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -# Forces legecy servers to use gsquery +# Forces legacy servers to use gsquery if [ -z "${gsquery}" ]; then gsquery="yes" fi diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 31c022eb3..5a097aaaf 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -2,7 +2,7 @@ # LGSM update_steamcmd.sh function # Author: Daniel Gibbs # Website: https://gameservermanagers.com -# Description:Handles updating using steamCMD. +# Description: Handles updating using SteamCMD. local commandname="UPDATE" local commandaction="Update" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index cd147a928..6f126b8a7 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -179,19 +179,19 @@ fn_setstatus(){ else (command_stop.sh > /dev/null 2>&1) fi - if [ "${counter}" -gt "5" ]; then - currentstatus="FAIL" - echo "Current status: ${currentstatus}" - echo "" - echo "Unable to start or stop server." - exit 1 - fi - done - echo -ne "New status: ${currentstatus}\\r" - echo -e "\n" - echo "Test starting:" - echo "" - sleep 0.5 + if [ "${counter}" -gt "5" ]; then + currentstatus="FAIL" + echo "Current status: ${currentstatus}" + echo "" + echo "Unable to start or stop server." + exit 1 + fi + done + echo -ne "New status: ${currentstatus}\\r" + echo -e "\n" + echo "Test starting:" + echo "" + sleep 0.5 } # End of every test will expect the result to either pass or fail @@ -465,7 +465,7 @@ echo "" echo "4.8 - validate - online" echo "=================================" echo "Description:" -echo "validate server files while server while already running." +echo "validate server files while server already running." echo "" echo "Command: ./jc2server validate" requiredstatus="ONLINE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index b83e1169a..e64963b66 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -168,19 +168,19 @@ fn_setstatus(){ else (command_stop.sh > /dev/null 2>&1) fi - if [ "${counter}" -gt "5" ]; then - currentstatus="FAIL" - echo "Current status: ${currentstatus}" - echo "" - echo "Unable to start or stop server." - exit 1 - fi - done - echo -ne "New status: ${currentstatus}\\r" - echo -e "\n" - echo "Test starting:" - echo "" - sleep 0.5 + if [ "${counter}" -gt "5" ]; then + currentstatus="FAIL" + echo "Current status: ${currentstatus}" + echo "" + echo "Unable to start or stop server." + exit 1 + fi + done + echo -ne "New status: ${currentstatus}\\r" + echo -e "\n" + echo "Test starting:" + echo "" + sleep 0.5 } # End of every test will expect the result to either pass or fail