diff --git a/7DaysToDie/sdtdserver b/7DaysToDie/sdtdserver index f162505c0..72a7bcaf8 100644 --- a/7DaysToDie/sdtdserver +++ b/7DaysToDie/sdtdserver @@ -43,8 +43,8 @@ parms="-logfile ${gamelogdir}/output_log__`date +%Y-%m-%d__%H-%M-%S`.txt -quit - # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index bedae9e1f..58840fd0f 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 #### @@ -48,8 +48,8 @@ parms="TheIsland?listen?MultiHome=${ip}?SessionName=${servername}?MaxPlayers=${m # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/Arma3/arma3server b/Arma3/arma3server index 9f4c64e03..70039ba37 100644 --- a/Arma3/arma3server +++ b/Arma3/arma3server @@ -59,8 +59,8 @@ bepath="" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/Battlefield1942/bf1942server b/Battlefield1942/bf1942server new file mode 100644 index 000000000..ba3f93587 --- /dev/null +++ b/Battlefield1942/bf1942server @@ -0,0 +1,141 @@ +#!/bin/bash +# Battlefield: 1942 +# 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" + +# Start Variables +ip="0.0.0.0" + +fn_parms(){ +parms=" +hostServer 1 +dedicated 1" +} + +#### 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" + +# Server Details +servicename="bf1942-server" +gamename="Battlefield: 1942" +engine="refractor" + +# Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +filesdir="${rootdir}/serverfiles" +systemdir="${filesdir}" +executabledir="${systemdir}" +executable="./start.sh" +servercfg="serversettings.con" +servercfgdir="${systemdir}/mods/bf1942/settings" +servercfgfullpath="${servercfgdir}/${servercfg}" +backupdir="${rootdir}/backups" + +# Logging +logdays="7" +gamelogdir="${filesdir}/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 diff --git a/BlackMesa/bmdmserver b/BlackMesa/bmdmserver index 7aceb5515..9250d2a5b 100644 --- a/BlackMesa/bmdmserver +++ b/BlackMesa/bmdmserver @@ -53,8 +53,8 @@ parms="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/BladeSymphony/bsserver b/BladeSymphony/bsserver index 8289b0544..4d9960123 100644 --- a/BladeSymphony/bsserver +++ b/BladeSymphony/bsserver @@ -48,8 +48,8 @@ parms="-autoupdate -strictportbind -ip ${ip} -port ${port} +clientport ${clientp # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/BrainBread2/bb2server b/BrainBread2/bb2server index 09c835790..669be4e11 100644 --- a/BrainBread2/bb2server +++ b/BrainBread2/bb2server @@ -53,8 +53,8 @@ parms="-game brainbread2 -insecure -strictportbind -ip ${ip} -port ${port} +clie # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/CodenameCURE/ccserver b/CodenameCURE/ccserver index 63f6d5030..7abd395cf 100644 --- a/CodenameCURE/ccserver +++ b/CodenameCURE/ccserver @@ -48,8 +48,8 @@ parms="-game cure -insecure -strictportbind -ip ${ip} -port ${port} +clientport # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/CounterStrike/csserver b/CounterStrike/csserver index 6e684eba0..9871f6ac2 100644 --- a/CounterStrike/csserver +++ b/CounterStrike/csserver @@ -47,8 +47,8 @@ parms="-game cstrike -strictportbind +ip ${ip} -port ${port} +clientport ${clien # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver index 53fb4d9ac..13fe3da1e 100644 --- a/CounterStrikeConditionZero/csczserver +++ b/CounterStrikeConditionZero/csczserver @@ -47,8 +47,8 @@ parms="-game czero -strictportbind +ip ${ip} -port ${port} +clientport ${clientp # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/CounterStrikeGlobalOffensive/csgoserver b/CounterStrikeGlobalOffensive/csgoserver index b1b3ceedc..1f8c42864 100755 --- a/CounterStrikeGlobalOffensive/csgoserver +++ b/CounterStrikeGlobalOffensive/csgoserver @@ -71,8 +71,8 @@ parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport $ # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/CounterStrikeSource/cssserver b/CounterStrikeSource/cssserver index e6cb9b473..27d58cc60 100644 --- a/CounterStrikeSource/cssserver +++ b/CounterStrikeSource/cssserver @@ -38,9 +38,14 @@ clientport="27005" ip="0.0.0.0" updateonstart="off" +# Required: Game Server Login Token +# GSLT is required 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 cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +parms="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" } #### Advanced Variables #### @@ -48,8 +53,8 @@ parms="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clien # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver index 43f8fa110..12168ee28 100644 --- a/DayOfDefeat/dodserver +++ b/DayOfDefeat/dodserver @@ -47,8 +47,8 @@ parms="-game dod -strictportbind +ip ${ip} -port ${port} +clientport ${clientpor # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/DayOfDefeatSource/dodsserver b/DayOfDefeatSource/dodsserver index 8c90f3893..545b0a50d 100644 --- a/DayOfDefeatSource/dodsserver +++ b/DayOfDefeatSource/dodsserver @@ -48,8 +48,8 @@ parms="-game dod -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/DayOfInfamy/doiserver b/DayOfInfamy/doiserver index 3dde94acf..b8641bc87 100644 --- a/DayOfInfamy/doiserver +++ b/DayOfInfamy/doiserver @@ -50,8 +50,8 @@ parms="-game doi -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/DeathmatchClassic/dmcserver b/DeathmatchClassic/dmcserver index e41515dbb..654072aa5 100644 --- a/DeathmatchClassic/dmcserver +++ b/DeathmatchClassic/dmcserver @@ -47,8 +47,8 @@ parms="-game dmc -strictportbind +ip ${ip} -port ${port} +clientport ${clientpor # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/DontStarveTogether/dstserver b/DontStarveTogether/dstserver index 9bca51889..e9ecfbd05 100644 --- a/DontStarveTogether/dstserver +++ b/DontStarveTogether/dstserver @@ -46,8 +46,8 @@ parms="-console -cluster MyDediServer -shard Master" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/DoubleActionBoogaloo/dabserver b/DoubleActionBoogaloo/dabserver index 2ff486791..41e3d4cd8 100644 --- a/DoubleActionBoogaloo/dabserver +++ b/DoubleActionBoogaloo/dabserver @@ -48,8 +48,8 @@ parms="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_por # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/EmpiresMod/emserver b/EmpiresMod/emserver index 40ec7116c..3d51fbff7 100644 --- a/EmpiresMod/emserver +++ b/EmpiresMod/emserver @@ -53,8 +53,8 @@ parms="-game empires -strictportbind -ip ${ip} -port ${port} +clientport ${clien # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/EnemyTerritory/cfg/lgsm-default.cfg b/EnemyTerritory/cfg/lgsm-default.cfg new file mode 100644 index 000000000..326e27fc9 --- /dev/null +++ b/EnemyTerritory/cfg/lgsm-default.cfg @@ -0,0 +1,125 @@ +set dedicated "2" // 1: dedicated server for lan 2: dedicated server for internet +// set net_ip "" // set to override the default IP ET uses +// set net_port "27960" // set to override the default port ET uses + +// PASSWORDS & CLIENTS + +set sv_maxclients "20" // number of players including private slots +set g_password "" // set to password protect the server +set sv_privateclients "4" // if set > 0, then this number of client slots will be reserved for connections +set sv_privatepassword "" // that have "password" set to the value of "sv_privatePassword" +set rconpassword "" // remote console access password +set refereePassword "" // referee status password + +// DL, RATE + +set sv_maxRate "13000" // 10000 standard but poor for ET +set sv_dl_maxRate "42000" // increase/decerease if you have plenty/little spare bandwidth +set sv_allowDownload "0" // global toggle for both legacy download and web download +set sv_wwwDownload "0" // toggle to enable web download +set sv_wwwBaseURL "" // base URL for redirection +set sv_wwwDlDisconnected "0" // tell clients to perform their downloads while disconnected from the server +set sv_wwwFallbackURL "" // URL to send to if an http/ftp fails or is refused client side + +// MOTD ETC + +set sv_hostname "" // name of server here +set server_motd0 " ^NEnemy Territory ^7MOTD " // message in right corner of join screen here +set server_motd1 "" +set server_motd2 "" +set server_motd3 "" +set server_motd4 "" +set server_motd5 "" + +// MISC SETTINGS + +set g_heavyWeaponRestriction "100" +set g_antilag "1" +set g_altStopwatchMode "0" +set g_autofireteams "1" +set g_complaintlimit "6" +set g_ipcomplaintlimit "3" +set g_fastres "0" +set g_friendlyFire "1" +//set g_gametype "4" // Game type should be set from map rotation script +set g_minGameClients "8" +set g_maxlives "0" +set g_alliedmaxlives "0" +set g_axismaxlives "0" +set g_teamforcebalance "1" +set g_noTeamSwitching "0" +set g_voiceChatsAllowed "4" +set g_doWarmup "0" +set g_warmup "30" +set g_spectatorInactivity "0" +set sv_floodProtect "1" +set sv_allowDownload "1" +set sv_pure "1" +set sv_minping "0" +set sv_maxping "0" +set match_latejoin "1" +set match_minplayers "4" +set match_mutespecs "0" +set match_readypercent "100" +set match_timeoutcount "0" +set match_warmupDamage "1" +set team_maxplayers "0" +set team_nocontrols "1" +set pmove_fixed "0" +set pmove_msec "8" + +// LMS ONLY SETTINGS + +set g_lms_teamForceBalance "1" +set g_lms_roundlimit "3" +set g_lms_matchlimit "2" +set g_lms_currentMatch "0" +set g_lms_lockTeams "0" +set g_lms_followTeamOnly "1" + +// VOTING + +set g_allowVote "1" +set vote_limit "5" +set vote_percent "50" +set vote_allow_comp "1" +set vote_allow_gametype "1" +set vote_allow_kick "1" +set vote_allow_map "1" +set vote_allow_matchreset "1" +set vote_allow_mutespecs "1" +set vote_allow_nextmap "1" +set vote_allow_pub "1" +set vote_allow_referee "0" +set vote_allow_shuffleteams "1" +set vote_allow_swapteams "1" +set vote_allow_friendlyfire "1" +set vote_allow_timelimit "0" +set vote_allow_warmupdamage "1" +set vote_allow_antilag "1" +set vote_allow_balancedteams "1" +set vote_allow_muting "1" + +// PUNKBUSTER + +// sv_punkbuster is a readonly variable. Use +set sv_punkbuster on command line or use the command pb_sv_enable in the console +//pb_sv_enable + +// LOGGING + +set g_log "etserver.log" // Game logging +set g_logsync 0 +set logfile 0 // Console logging ( 1: enable 2: enable and sync ) + +// MAP ROTATION + +exec campaigncycle.cfg // Campaign mode +//exec objectivecycle.cfg // Objective mode +//exec lmscycle.cfg // Last Man Standing mode + +// WATCHDOG + +// in case the game dies with an ERR_DROP +// or any situation leading to server running with no map +//set com_watchdog 10 // defaults 60 +set com_watchdog_cmd "exec campaigncycle.cfg" // defaults to quit diff --git a/EnemyTerritory/etserver b/EnemyTerritory/etserver new file mode 100644 index 000000000..c49619f74 --- /dev/null +++ b/EnemyTerritory/etserver @@ -0,0 +1,143 @@ +#!/bin/bash +# Enemy Territory +# 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" + +# Start Variables +ip="0.0.0.0" +port="27960" + +fn_parms(){ + parms="+set net_strict 1 +set net_ip ${ip} +set net_port ${port} +set fs_homepath ${filesdir} +exec ${servicename}.cfg" +} + +#### Advanced Variables #### + +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="master" + +# Server Details +servicename="et-server" +gamename="Enemy Territory" +engine="idtech3" + +# Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +filesdir="${rootdir}/serverfiles" +systemdir="${filesdir}" +executabledir="${systemdir}" +executable="./etded" +servercfg="${servicename}.cfg" +servercfgdir="${systemdir}/etmain" +servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/lgsm-default.cfg" +backupdir="${rootdir}/backups" + +# Logging +logdays="7" +gamelogdir="${filesdir}/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 diff --git a/FistfulOfFrags/cfg/lgsm-default.cfg b/FistfulOfFrags/cfg/lgsm-default.cfg index 615720feb..39783e9d8 100644 --- a/FistfulOfFrags/cfg/lgsm-default.cfg +++ b/FistfulOfFrags/cfg/lgsm-default.cfg @@ -1,7 +1,7 @@ // **************************************************************************** // * // Fistful of Frags - server.cfg * -// Version 100116 * +// Version 240716 * // * // **************************************************************************** @@ -25,7 +25,7 @@ sv_lan 0 // ............................... Map Cycles ............................... // // info: There are several predefined mapcycles available that are listed below. -// You can also create your own custom mapcycle. +// You can also create your own custom mapcycle. // "mapcycle.txt" - All Shootout/2 Team Shootout/4 Team Shootout maps // "mapcycle_12.txt" - All 12 slot maps for Shootout/2 Team Shootout/4 Team Shootout @@ -50,7 +50,7 @@ mp_timelimit 15 // 3 = Break Bad // 4 = Elimination // 5 = Versus -fof_sv_currentmode 1 +fof_sv_currentmode 1 // Teamplay // 0 = Free-for-all @@ -98,7 +98,7 @@ sv_downloadurl "" // personal banlist based on user IDs. exec banned_user.cfg -// personal banlist based on user IPs. +// personal banlist based on user IPs. exec banned_ip.cfg writeid diff --git a/FistfulOfFrags/fofserver b/FistfulOfFrags/fofserver index 4a5e9d75f..1f263eee2 100644 --- a/FistfulOfFrags/fofserver +++ b/FistfulOfFrags/fofserver @@ -48,8 +48,8 @@ parms="-game fof -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/GarrysMod/gmodserver b/GarrysMod/gmodserver index bc21fda29..7c9179c4b 100644 --- a/GarrysMod/gmodserver +++ b/GarrysMod/gmodserver @@ -69,8 +69,8 @@ parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate ${tickr # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/GoldenEyeSource/gesserver b/GoldenEyeSource/gesserver index 1d7293cde..deefdbb9c 100644 --- a/GoldenEyeSource/gesserver +++ b/GoldenEyeSource/gesserver @@ -49,8 +49,8 @@ parms="-game gesource -strictportbind -ip ${ip} -port ${port} +clientport ${clie # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam - 2007 SDK diff --git a/HalfLife2Deathmatch/hl2dmserver b/HalfLife2Deathmatch/hl2dmserver index 3d7bf06fa..df2a3060b 100644 --- a/HalfLife2Deathmatch/hl2dmserver +++ b/HalfLife2Deathmatch/hl2dmserver @@ -48,8 +48,8 @@ parms="-game hl2mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientp # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/HalfLifeDeathmatch/hldmserver b/HalfLifeDeathmatch/hldmserver index 477eaba63..57a414f1f 100644 --- a/HalfLifeDeathmatch/hldmserver +++ b/HalfLifeDeathmatch/hldmserver @@ -47,8 +47,8 @@ parms="-game valve -strictportbind +ip ${ip} -port ${port} +clientport ${clientp # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/HalfLifeDeathmatchSource/hldmsserver b/HalfLifeDeathmatchSource/hldmsserver index ee8060dea..7e847fa12 100644 --- a/HalfLifeDeathmatchSource/hldmsserver +++ b/HalfLifeDeathmatchSource/hldmsserver @@ -48,8 +48,8 @@ parms="-game hl1mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientp # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 6929b5324..34728b3c8 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -62,8 +62,8 @@ parms="-batchmode -nographics -exec \"host ${port} ${map} ${loadsave};queryport # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/Insurgency/insserver b/Insurgency/insserver index 1acace084..ae7937733 100644 --- a/Insurgency/insserver +++ b/Insurgency/insserver @@ -50,8 +50,8 @@ parms="-game insurgency -strictportbind -ip ${ip} -port ${port} +clientport ${cl # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/JustCause2/jc2server b/JustCause2/jc2server index 76ab6dfe8..1c97e6a4d 100644 --- a/JustCause2/jc2server +++ b/JustCause2/jc2server @@ -42,8 +42,8 @@ parms="" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/KillingFloor/kfserver b/KillingFloor/kfserver index 15a5ff522..40f35d77c 100644 --- a/KillingFloor/kfserver +++ b/KillingFloor/kfserver @@ -47,8 +47,8 @@ parms="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/Left4Dead/l4dserver b/Left4Dead/l4dserver index d7507a042..ac7fdc425 100644 --- a/Left4Dead/l4dserver +++ b/Left4Dead/l4dserver @@ -48,8 +48,8 @@ parms="-game left4dead -strictportbind -ip ${ip} -port ${port} +clientport ${cli # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server index f92f589e9..7d38cd071 100644 --- a/Left4Dead2/l4d2server +++ b/Left4Dead2/l4d2server @@ -47,8 +47,8 @@ parms="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${cl # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/Minecraft/cfg/lgsm-default.ini b/Minecraft/cfg/lgsm-default.ini new file mode 100644 index 000000000..8e350192c --- /dev/null +++ b/Minecraft/cfg/lgsm-default.ini @@ -0,0 +1,40 @@ +#Minecraft server properties (LGSM 210516) +#Sat Aug 20 17:30:15 CEST 2016 +allow-flight=false +allow-nether=true +announce-player-achievements=true +difficulty=1 +enable-command-block=false +enable-query=false +enable-rcon=false +force-gamemode=false +gamemode=0 +generate-structures=true +generator-settings= +hardcore=false +level-name=world +level-seed= +level-type=DEFAULT +max-build-height=256 +max-players=20 +max-tick-time=60000 +max-world-size=29999984 +motd=A Minecraft Server +network-compression-threshold=256 +online-mode=true +op-permission-level=4 +player-idle-timeout=0 +pvp=true +rcon.password= +rcon.port=25575 +resource-pack-sha1= +resource-pack= +server-ip= +server-port=25565 +snooper-enabled=true +spawn-animals=true +spawn-monsters=true +spawn-npcs=true +use-native-transport=true +view-distance=10 +white-list=false diff --git a/Minecraft/mcserver b/Minecraft/mcserver new file mode 100644 index 000000000..e9bb190fe --- /dev/null +++ b/Minecraft/mcserver @@ -0,0 +1,142 @@ +#!/bin/bash +# Minecraft +# 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="210816" + +#### Variables #### + +# Notification Alerts +# (on|off) + +# Email +emailalert="off" +email="email@example.com" + +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + +# Start Variables +updateonstart="off" +javaram="1024" # -Xmx$1024M + +fn_parms(){ +parms="nogui" +} + +#### Advanced Variables #### + +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="master" + +# Server Details +servicename="mc-server" +gamename="Minecraft" +engine="lwjgl2" + +# 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}" +executabledir="${filesdir}" +executable="java -Xmx${javaram}M -jar minecraft_server.jar" +servercfg="server.properties" +servercfgdir="${filesdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/lgsm-default.ini" +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 diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index 54d0b4e71..ba7db3da3 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -38,8 +38,8 @@ parms="-fg -ini ${servercfgfullpath}" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" diff --git a/NS2Combat/ns2cserver b/NS2Combat/ns2cserver index 034848163..559511eec 100644 --- a/NS2Combat/ns2cserver +++ b/NS2Combat/ns2cserver @@ -55,8 +55,8 @@ parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/NaturalSelection2/ns2server b/NaturalSelection2/ns2server index 1190f4a12..94320f0da 100644 --- a/NaturalSelection2/ns2server +++ b/NaturalSelection2/ns2server @@ -55,8 +55,8 @@ parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver index baca45cd3..0a68e2812 100644 --- a/NoMoreRoomInHell/nmrihserver +++ b/NoMoreRoomInHell/nmrihserver @@ -53,8 +53,8 @@ parms="-game nmrih -insecure -strictportbind -ip ${ip} -port ${port} +clientport # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/OpposingForce/opforserver b/OpposingForce/opforserver index 394c1a6a7..58f72e481 100644 --- a/OpposingForce/opforserver +++ b/OpposingForce/opforserver @@ -47,8 +47,8 @@ parms="-game gearbox -strictportbind +ip ${ip} -port ${port} +clientport ${clien # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/PiratesVikingandKnightsII/pvkiiserver b/PiratesVikingandKnightsII/pvkiiserver index 4091735b3..5abecfa19 100644 --- a/PiratesVikingandKnightsII/pvkiiserver +++ b/PiratesVikingandKnightsII/pvkiiserver @@ -48,8 +48,8 @@ parms="-game pvkii -strictportbind -ip ${ip} -port ${port} +clientport ${clientp # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver index dafab0d38..c07be1e49 100644 --- a/ProjectZomboid/pzserver +++ b/ProjectZomboid/pzserver @@ -44,8 +44,8 @@ parms="-ip ${ip} -adminpassword \"${adminpassword}\"" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/QuakeLive/qlserver b/QuakeLive/qlserver index 1e2ece42c..19b27b27e 100755 --- a/QuakeLive/qlserver +++ b/QuakeLive/qlserver @@ -51,8 +51,8 @@ fn_parms(){ # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/README.md b/README.md index 79748cc87..72e57fa62 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@

Linux Game Server Managers_

-linux Game Server Managers +linux Game Server Managers -[![Build Status](https://travis-ci.org/dgibbs64/linuxgsm.svg?branch=master)](https://travis-ci.org/dgibbs64/linuxgsm) -[![Under Development](https://badge.waffle.io/dgibbs64/linuxgsm.svg?label=Under%20Development&title=Under%20Development)](http://waffle.io/dgibbs64/linuxgsm) +[![Build Status](https://travis-ci.org/GameServerManagers/LinuxGSM.svg?branch=master)](https://travis-ci.org/GameServerManagers/LinuxGSM) +[![Under Development](https://badge.waffle.io/GameServerManagers/LinuxGSM.svg?label=Under%20Development&title=Under%20Development)](http://waffle.io/GameServerManagers/LinuxGSM) The Linux Game Server Managers are command line tools for quick, simple deployment and management of various dedicated game servers and voice alert servers. @@ -29,25 +29,25 @@ The Linux Game Server Managers are tested to work on the following Linux distros Other distros are likely to work but are not fully tested.

Specific Requirements

FAQ

All FAQ can be found here. -https://github.com/dgibbs64/linuxgsm/wiki/FAQ +https://github.com/GameServerManagers/LinuxGSM/wiki/FAQ

Donate

-If you want to donate to the project you can via PayPal, Flattr or Gratipay. I have had a may kind people show their support by sending me a donation. Any donations you send help cover my server costs and buy me a drink. Cheers! +If you want to donate to the project you can via PayPal. I have had a may kind people show their support by sending me a donation. Any donations you send help cover my server costs and buy me a drink. Cheers!

Useful Links

Social

diff --git a/RedOrchestra/roserver b/RedOrchestra/roserver index 8f3f0445f..1d0a39341 100644 --- a/RedOrchestra/roserver +++ b/RedOrchestra/roserver @@ -43,8 +43,8 @@ parms="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true -nohomedir in # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Server Details diff --git a/Ricochet/ricochetserver b/Ricochet/ricochetserver index ce9179a6a..68664448f 100644 --- a/Ricochet/ricochetserver +++ b/Ricochet/ricochetserver @@ -47,8 +47,8 @@ parms="-game ricochet -strictportbind +ip ${ip} -port ${port} +clientport ${clie # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/Rust/cfg/lgsm-default.cfg b/Rust/cfg/lgsm-default.cfg index 6d5ed99f8..225215e01 100644 --- a/Rust/cfg/lgsm-default.cfg +++ b/Rust/cfg/lgsm-default.cfg @@ -11,7 +11,7 @@ server.description "LGSM Server\nRust support : UltimateByte" # A URL to the image which shows up on the server details screen (dimensions are 512x256). -server.headerimage "https://github.com/dgibbs64/linuxgsm/raw/master/images/logo/lgsm-full-light.png" +server.headerimage "https://github.com/GameServerManagers/LinuxGSM/raw/master/images/logo/lgsm-full-light.png" # The URL to your servers website. server.url "https://gameservermanagers.com/" diff --git a/Rust/rustserver b/Rust/rustserver index a3eb75c43..afe0c662a 100644 --- a/Rust/rustserver +++ b/Rust/rustserver @@ -65,8 +65,8 @@ fi # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/SeriousSam3BFE/ss3sserver b/SeriousSam3BFE/ss3sserver index 29318d565..7302c282b 100644 --- a/SeriousSam3BFE/ss3sserver +++ b/SeriousSam3BFE/ss3sserver @@ -33,7 +33,7 @@ steampass="" ip="0.0.0.0" updateonstart="off" -# https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/SeriousSam3BFE/help/DedicatedServer_Readme.txt +# https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/SeriousSam3BFE/help/DedicatedServer_Readme.txt fn_parms(){ parms="+ip ${ip} +logfile ${gamelog} +exec ${servercfgfullpath}" } @@ -43,8 +43,8 @@ parms="+ip ${ip} +logfile ${gamelog} +exec ${servercfgfullpath}" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/Starbound/sbserver b/Starbound/sbserver index 762915c3d..3ad6afdf9 100644 --- a/Starbound/sbserver +++ b/Starbound/sbserver @@ -42,8 +42,8 @@ parms="" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/SvenCoop/svencoopserver b/SvenCoop/svencoopserver index 9687c1452..1043cdfd3 100644 --- a/SvenCoop/svencoopserver +++ b/SvenCoop/svencoopserver @@ -47,8 +47,8 @@ parms="-game svencoop -strictportbind +ip ${ip} -port ${port} +clientport ${clie # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/TeamFortress2/tf2server b/TeamFortress2/tf2server index ca8c2e150..335af8b4a 100644 --- a/TeamFortress2/tf2server +++ b/TeamFortress2/tf2server @@ -53,8 +53,8 @@ parms="-game tf -strictportbind -ip ${ip} -port ${port} +clientport ${clientport # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/TeamFortressClassic/tfcserver b/TeamFortressClassic/tfcserver index 476e6c68a..53455703e 100644 --- a/TeamFortressClassic/tfcserver +++ b/TeamFortressClassic/tfcserver @@ -47,8 +47,8 @@ parms="-game tfc -strictportbind _ip ${ip} -port ${port} +clientport ${clientpor # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/TeamSpeak3/ts3server b/TeamSpeak3/ts3server index c297e8876..1e7ad5952 100644 --- a/TeamSpeak3/ts3server +++ b/TeamSpeak3/ts3server @@ -63,8 +63,8 @@ scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S' # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" ##### Script ##### diff --git a/Teeworlds/twserver b/Teeworlds/twserver index 6b29f0e81..cd81024c0 100644 --- a/Teeworlds/twserver +++ b/Teeworlds/twserver @@ -43,8 +43,8 @@ parms="-f ${servercfgfullpath}" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/Terraria/terrariaserver b/Terraria/terrariaserver index f51fb642a..9dd94a0f5 100644 --- a/Terraria/terrariaserver +++ b/Terraria/terrariaserver @@ -43,8 +43,8 @@ parms="-config ${servercfgfullpath}" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Steam diff --git a/UnrealTournament/cfg/Engine.ini b/UnrealTournament/cfg/Engine.ini new file mode 100644 index 000000000..177eaafdb --- /dev/null +++ b/UnrealTournament/cfg/Engine.ini @@ -0,0 +1,3 @@ +[/Script/UnrealTournament.UTGameEngine] +bFirstRun=False +RconPassword="" diff --git a/UnrealTournament/cfg/Game.ini b/UnrealTournament/cfg/Game.ini new file mode 100644 index 000000000..15a1c9159 --- /dev/null +++ b/UnrealTournament/cfg/Game.ini @@ -0,0 +1,4 @@ +[/Script/UnrealTournament.UTGameState] +ServerName="" +ServerMOTD=WELCOME\n\nHeadshots for everyone. +ServerDescription=This is my server, have fun diff --git a/UnrealTournament/utserver b/UnrealTournament/utserver new file mode 100644 index 000000000..f7e5e2981 --- /dev/null +++ b/UnrealTournament/utserver @@ -0,0 +1,147 @@ +#!/bin/bash +# Unreal Tournament +# 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" + +# Start Variables +defaultmap="DM-Underland" +gametype="DM" +#defaultmap="CTF-Face" +#gametype="CTF" +timelimit="10" +ip="0.0.0.0" +port="7777" + +fn_parms(){ +parms="UnrealTournament ${defaultmap}?Game=${gametype}?TimeLimit=${timelimit} -port=${port}" +} + +#### Advanced Variables #### + +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="master" + +# Server Details +servicename="ut-server" +gamename="Unreal Tournament" +engine="unreal4" + +# Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +filesdir="${rootdir}/serverfiles" +systemdir="${filesdir}/LinuxServer" +executabledir="${systemdir}/Engine/Binaries/Linux" +executable="./UE4Server-Linux-Shipping" +servercfg="Game.ini" +servercfgdir="${systemdir}/UnrealTournament/Saved/Config/LinuxServer" +servercfgfullpath="${servercfgdir}/${servercfg}" +backupdir="${rootdir}/backups" + +# Logging +logdays="7" +gamelogdir="${filesdir}/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 diff --git a/UnrealTournament2004/ut2k4server b/UnrealTournament2004/ut2k4server index 9515059d3..4eec3e473 100644 --- a/UnrealTournament2004/ut2k4server +++ b/UnrealTournament2004/ut2k4server @@ -75,8 +75,8 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" ##### Script ##### diff --git a/UnrealTournament3/ut3server b/UnrealTournament3/ut3server new file mode 100644 index 000000000..97f768974 --- /dev/null +++ b/UnrealTournament3/ut3server @@ -0,0 +1,155 @@ +#!/bin/bash +# Unreal Tournament 3 +# 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" + +# Start Variables +ip="0.0.0.0" +port="7777" +queryport="25300" +defaultmap="VCTF-Suspense" +game="UTGameContent.UTVehicleCTFGame_Content" +mutators="" #"UTGame.UTMutator_Instagib,UTGame.UTMutator_LowGrav" +isdedicated="true" +islanmatch="false" +usesstats="false" +shouldadvertise="true" +pureserver="1" +allowjoininprogress="true" +maxplayers="32" + +#list of game types and mutators : http://wiki.unrealadmin.org/FAQ:UT3 +fn_parms(){ +parms="server ${defaultmap}?Game=${game}?bIsDedicated=${isdedicated}?bIsLanMatch=${islanmatch}?bUsesStats=${usesstats}?bShouldAdvertise=${shouldadvertise}?PureServer=${pureserver}?bAllowJoinInProgress=${allowjoininprogress}?MaxPlayers=${maxplayers}?Mutator=${mutators} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" +} + +# Server Details +servicename="ut3-server" +gamename="Unreal Tournament 3" +engine="unreal3" + +# Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" +filesdir="${rootdir}/serverfiles" +systemdir="${filesdir}" +executabledir="${systemdir}/Binaries" +executable="./ut3" +servercfg="UTGame.ini" +servercfgdir="${systemdir}/UTGame/Config" +servercfgfullpath="${servercfgdir}/${servercfg}" +backupdir="${rootdir}/backups" + +# Logging +logdays="7" +gamelogdir="${rootdir}/log/server" +scriptlogdir="${rootdir}/log/script" +consolelogdir="${rootdir}/log/console" +consolelogging="on" + +gamelog="${gamelogdir}/${servicename}-game.log" +scriptlog="${scriptlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +emaillog="${scriptlogdir}/${servicename}-email.log" + +gamelogdate="${gamelogdir}/${servicename}-game-$(date '+%d-%m-%Y-%H-%M-%S').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" + +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="GameServerManagers" +githubrepo="LinuxGSM" +githubbranch="master" + +##### 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 + diff --git a/UnrealTournament99/ut99server b/UnrealTournament99/ut99server index b8208117d..aa4dc9339 100644 --- a/UnrealTournament99/ut99server +++ b/UnrealTournament99/ut99server @@ -38,8 +38,8 @@ parms="server ${defaultmap}.unr ini=${servercfgfullpath}" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="master" # Server Details diff --git a/functions/core_functions.sh b/functions/core_functions.sh index 3e6d2fb1c..287a50897 100644 --- a/functions/core_functions.sh +++ b/functions/core_functions.sh @@ -15,10 +15,10 @@ fi fn_fetch_core_dl(){ if [ -z "${githubuser}" ]; then - githubuser="dgibbs64" + githubuser="GameServerManagers" fi if [ -z "${githubrepo}" ]; then - githubrepo="linuxgsm" + githubrepo="LinuxGSM" fi if [ -z "${githubbranch}" ]; then githubbranch="master" diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 57f432ec4..1939937ec 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -73,7 +73,7 @@ fn_found_missing_deps(){ sleep 1 sudo -v > /dev/null 2>&1 if [ $? -eq 0 ]; then - fn_print_infomation_nl "Automatically installing missing dependencies." + fn_print_information_nl "Automatically installing missing dependencies." fn_script_log_info "Automatically installing missing dependencies." echo -en ".\r" sleep 1 @@ -120,7 +120,7 @@ fn_check_loop(){ fn_deps_detector done - # user to be informaed of any missing dependecies + # user to be informed of any missing dependencies fn_found_missing_deps } @@ -128,7 +128,7 @@ info_distro.sh if [ "${function_selfname}" == "command_install.sh" ]; then echo "" - echo "Checking Dependecies" + echo "Checking Dependencies" echo "=================================" fi @@ -149,8 +149,8 @@ if [ -n "$(command -v dpkg-query)" ]; then fi fi - # All servers except ts3 & mumble require libstdc++6, lib32gcc1 - if [ "${gamename}" != "TeamSpeak 3" ]||[ "${gamename}" != "Mumble" ]; then + # All servers except ts3,mumble and minecraft servers require libstdc++6 and lib32gcc1 + if [ "${gamename}" != "TeamSpeak 3" ]||[ "${gamename}" != "Mumble" ]||[ "${engine}" != "lwjgl2" ]; then if [ "${arch}" == "x86_64" ]; then array_deps_required+=( lib32gcc1 libstdc++6:i386 ) else @@ -176,10 +176,13 @@ 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 + # Battlefield: 1942 requies ncurses + elif [ "${gamename}" == "Battlefield: 1942" ]; then + array_deps_required+=( libncurses5:i386 ) + # Project Zomboid and Minecraft + elif [ "${engine}" == "projectzomboid" ]||[ "${engine}" == "lwjgl2" ]; then array_deps_required+=( default-jdk ) - # Unreal engine + # Unreal Engine elif [ "${executable}" == "./ucc-bin" ]; then #UT2K4 if [ -f "${executabledir}/ut2004-bin" ]; then @@ -188,6 +191,9 @@ if [ -n "$(command -v dpkg-query)" ]; then else array_deps_required+=( libsdl1.2debian bzip2 ) fi + # Unreal Tournament + elif [ "${gamename}" == "Unreal Tournament" ]; then + array_deps_required+=( unzip ) fi fn_deps_email fn_check_loop @@ -212,8 +218,8 @@ elif [ -n "$(command -v yum)" ]; then fi fi - # All servers excelts ts3 & mumble require glibc.i686 libstdc++.i686 - if [ "${executable}" != "./ts3server_startscript.sh" ]||[ "${executable}" != "./murmur.x86" ]; then + # All servers except ts3,mumble and minecraft servers require glibc.i686 and libstdc++.i686 + if [ "${gamename}" != "TeamSpeak 3" ]||[ "${gamename}" != "Mumble" ]||[ "${engine}" != "lwjgl2" ]; then array_deps_required+=( glibc.i686 libstdc++.i686 ) fi @@ -231,8 +237,8 @@ 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 + # Project Zomboid and Minecraft + elif [ "${engine}" == "projectzomboid" ]||[ "${engine}" == "lwjgl2" ]; then array_deps_required+=( java-1.8.0-openjdk ) # Unreal Engine elif [ "${executable}" == "./ucc-bin" ]; then @@ -243,6 +249,9 @@ elif [ -n "$(command -v yum)" ]; then else array_deps_required+=( SDL.i686 bzip2 ) fi + # Unreal Tournament + elif [ "${gamename}" == "Unreal Tournament" ]; then + array_deps_required+=( unzip ) fi fn_deps_email fn_check_loop diff --git a/lgsm/functions/check_glibc.sh b/lgsm/functions/check_glibc.sh index 2fcd6e8a1..85caf6d01 100644 --- a/lgsm/functions/check_glibc.sh +++ b/lgsm/functions/check_glibc.sh @@ -35,7 +35,7 @@ elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n echo -e " * glibc required: ${glibcrequired}" echo -e " * glibc installed: ${red}${glibcversion}${default}" echo -en "\n" - fn_print_infomation "The game server will probably not work. A distro upgrade is required!" + fn_print_information "The game server will probably not work. A distro upgrade is required!" sleep 5 fi fi \ No newline at end of file diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index 8c1c264c2..1a64db6bd 100644 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -8,7 +8,7 @@ local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -if [ "${gamename}" != "TeamSpeak 3" ]; then +if [ "${gamename}" != "TeamSpeak 3" ] && [ "${gamename}" != "Mumble" ]; then if [ ! -f "/bin/ip" ]; then ipcommand="/sbin/ip" else @@ -24,7 +24,7 @@ if [ "${gamename}" != "TeamSpeak 3" ]; then fn_print_fail "Check IP: Multiple active network interfaces found." sleep 1 echo -en "\n" - fn_print_infomation "Specify the IP you want to use within the ${selfname} script.\n" + fn_print_information "Specify the IP you want to use within the ${selfname} script.\n" echo -en "Set ip=\"0.0.0.0\" to one of the following:\n" echo -en "${getip}\n" echo -en "" diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index c41f8d67f..297bf16d6 100644 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -9,19 +9,44 @@ local commandname="CHECK" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" fn_check_ownership(){ + if [ -f "${rootdir}/${selfname}" ]; then + if [ $(find "${rootdir}/${selfname}" -not -user $(whoami)|wc -l) -ne "0" ]; then + selfownissue=1 + fi + fi + if [ -d "${functionsdir}" ]; then + if [ $(find "${functionsdir}" -not -user $(whoami)|wc -l) -ne "0" ]; then + funcownissue=1 + fi + fi if [ -d "${filesdir}" ]; 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 "${filesdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" - } | column -s $'\t' -t | tee -a "${scriptlog}" - core_exit.sh + if [ $(find "${filesdir}" -not -user $(whoami)|wc -l) -ne "0" ]; then + filesownissue=1 fi fi + if [ "${selfownissue}" == "1" ]||[ "${funcownissue}" == "1" ]||[ "${filesownissue}" == "1" ]; then + fn_print_fail_nl "Ownership issues found" + fn_script_log_fatal "Ownership issues found" + fn_print_information_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" + if [ "${selfownissue}" == "1" ]; then + find "${rootdir}/${selfname}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" + fi + if [ "${funcownissue}" == "1" ]; then + find "${functionsdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" + fi + if [ "${funcownissue}" == "1" ]; then + find "${filesdir}" -not -user $(whoami) -printf "%u\t\t%g\t%p\n" + fi + + } | column -s $'\t' -t | tee -a "${scriptlog}" + echo "" + fn_print_information_nl "For more information, please see https://github.com/GameServerManagers/LinuxGSM/wiki/FAQ#-fail--starting-game-server-permissions-issues-found" + fn_script_log "For more information, please see https://github.com/GameServerManagers/LinuxGSM/wiki/FAQ#-fail--starting-game-server-permissions-issues-found" + core_exit.sh + fi } fn_check_permissions(){ @@ -29,7 +54,7 @@ fn_check_permissions(){ if [ $(find "${functionsdir}" -type f -not -executable|wc -l) -ne "0" ]; then fn_print_fail_nl "Permissions issues found" fn_script_log_fatal "Permissions issues found" - fn_print_infomation_nl "The following files are not executable:" + fn_print_information_nl "The following files are not executable:" fn_script_log_info "The following files are not executable:" { echo -e "File\n" @@ -49,7 +74,7 @@ fn_check_permissions(){ if [ "${userrootdirperm}" != "7" ] && [ "${grouprootdirperm}" != "7" ]; then fn_print_fail_nl "Permissions issues found" fn_script_log_fatal "Permissions issues found" - fn_print_infomation_nl "The following directorys does not have the correct permissions:" + fn_print_information_nl "The following directorys does not have the correct permissions:" fn_script_log_info "The following directorys does not have the correct permissions:" ls -l "${rootdir}" core_exit.sh diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/functions/check_steamcmd.sh index 01da9cda2..1e0f66cd7 100644 --- a/lgsm/functions/check_steamcmd.sh +++ b/lgsm/functions/check_steamcmd.sh @@ -51,7 +51,7 @@ fn_check_steamcmd_sh(){ fn_install_steamcmd fi elif [ "${function_selfname}" == "command_install.sh" ]; then - fn_print_infomation "SteamCMD is already installed..." + fn_print_information "SteamCMD is already installed..." fn_print_ok_eol_nl fi } diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index 1d735642d..a46c3d0e3 100644 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -21,6 +21,11 @@ if [ "${gamename}" == "ARMA 3" ]; then ramrequirementgb="1" fi +if [ "${gamename}" == "Minecraft" ]; then + ramrequirementmb="1000" + ramrequirementgb="1" +fi + # If the game or engine has a minimum RAM Requirement, compare it to system's available RAM. if [ -n "${ramrequirementmb}" ]; then if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index cbac77f7a..fb3531cc3 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributor: UltimateByte # Website: https://gameservermanagers.com -# Description: Displays server infomation. +# Description: Displays server information. local commandname="DETAILS" local commandaction="Details" @@ -106,7 +106,9 @@ fn_details_gameserver(){ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = { # Server name - echo -e "${blue}Server name:\t${default}${servername}" + if [ -n "${servername}" ]; then + echo -e "${blue}Server name:\t${default}${servername}" + fi # Server ip echo -e "${blue}Server IP:\t${default}${ip}:${port}" @@ -287,14 +289,15 @@ 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" ) + # engines that require editing in the config file + local ports_edit_array=( "avalanche" "dontstarve" "idtech3" "lwjgl2" "projectzomboid" "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 parmslocation="${servercfgfullpath}" fi done - + # engines that require editing in the script file local ports_edit_array=( "starbound" "spark" "source" "goldsource" "Rust" "Hurtworld" "unreal4") for port_edit in "${ports_edit_array[@]}" do @@ -337,6 +340,15 @@ fn_details_dontstarve(){ } | column -s $'\t' -t } +fn_details_minecraft(){ + echo -e "netstat -atunp | grep java" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + fn_details_projectzomboid(){ echo -e "netstat -atunp | grep java" echo -e "" @@ -591,6 +603,8 @@ if [ "${engine}" == "avalanche" ]; then fn_details_avalanche elif [ "${engine}" == "dontstarve" ]; then fn_details_dontstarve +elif [ "${engine}" == "lwjgl2" ]; then + fn_details_minecraft elif [ "${engine}" == "projectzomboid" ]; then fn_details_projectzomboid elif [ "${engine}" == "idtech3" ]; then diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 71a2ecff5..32fe47172 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -29,7 +29,7 @@ fn_check_bzip2(){ echo -en "\n" sleep 1 echo "We advise using it" - echo "For more information, see https://github.com/dgibbs64/linuxgsm/wiki/FastDL#bzip2-compression" + echo "For more information, see https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL#bzip2-compression" sleep 2 else bzip2installed="1" @@ -310,7 +310,7 @@ fn_fastdl_completed(){ sleep 2 echo -en "\n" echo "" - fn_print_info "Need more documentation? See https://github.com/dgibbs64/linuxgsm/wiki/FastDL" + fn_print_info "Need more documentation? See https://github.com/GameServerManagers/LinuxGSM/wiki/FastDL" echo -en "\n" if [ "$bzip2installed" == "0" ]; then echo "By the way, you'd better install bzip2 and re-run this command!" diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index ac66e96e4..b4beceed4 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 3" ]||[ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Enemy Territory" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Minecraft" ]||[ "${gamename}" == "Mumble" ]; then installer=1 install_server_files.sh elif [ -n "${appid}" ]; then diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 572225c18..a98246b63 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -9,7 +9,7 @@ local commandname="STOP" local commandaction="Stopping" local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -# Attempts Graceful of source using rcon 'quit' command. +# Attempts graceful of source using rcon 'quit' command. fn_stop_graceful_source(){ fn_print_dots "Graceful: rcon quit" fn_script_log_info "Graceful: rcon quit" @@ -37,7 +37,7 @@ fn_stop_graceful_source(){ fn_stop_tmux } -# Attempts Graceful of goldsource using rcon 'quit' command. +# Attempts graceful of goldsource using rcon 'quit' command. # Goldsource 'quit' command restarts rather than shutsdown # this function will only wait 3 seconds then force a tmux shutdown. # preventing the server from coming back online. @@ -58,7 +58,7 @@ fn_stop_graceful_goldsource(){ fn_stop_tmux } -# Attempts Graceful of 7 Days To Die using telnet. +# Attempts graceful of 7 Days To Die using telnet. fn_stop_telnet_sdtd(){ sdtd_telnet_shutdown=$( expect -c ' proc abort {} { @@ -144,6 +144,34 @@ fn_stop_graceful_sdtd(){ fn_stop_tmux } +# Attempts graceful of source using rcon '/stop' command. +fn_stop_graceful_minecraft(){ + fn_print_dots "Graceful: console /stop" + fn_script_log_info "Graceful: console /stop" + # sends quit + tmux send -t "${servicename}" /stop ENTER > /dev/null 2>&1 + # waits up to 30 seconds giving the server time to shutdown gracefuly + for seconds in {1..30}; do + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_ok "Graceful: console /stop: ${seconds}: " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: console /stop: OK: ${seconds} seconds" + break + fi + sleep 1 + fn_print_dots "Graceful: console /stop: ${seconds}" + done + check_status.sh + if [ "${status}" != "0" ]; then + fn_print_error "Graceful: console /stop: " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: console /stop: FAIL" + fi + sleep 1 + fn_stop_tmux +} + fn_stop_graceful_select(){ if [ "${gamename}" == "7 Days To Die" ]; then fn_stop_graceful_sdtd @@ -151,6 +179,8 @@ fn_stop_graceful_select(){ fn_stop_graceful_source elif [ "${engine}" == "goldsource" ]; then fn_stop_graceful_goldsource + elif [ "${engine}" == "lwjgl2" ]; then + fn_stop_graceful_minecraft else fn_stop_tmux fi diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh index e260b8a2a..89c3cd036 100644 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -16,7 +16,7 @@ fn_serveradmin_password_prompt(){ echo "=================================" echo "" echo "Press \"CTRL+b d\" to exit console." - fn_print_infomation_nl "You are about to change the ${gamename} ServerAdmin password." + fn_print_information_nl "You are about to change the ${gamename} ServerAdmin password." fn_print_warning_nl "${gamename} will restart during this process." echo "" while true; do diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index d282cc432..bffa4e6ea 100644 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -15,6 +15,8 @@ check.sh if [ "${gamename}" == "TeamSpeak 3" ]; then update_ts3.sh +elif [ "${engine}" == "lwjgl2" ]; then + update_minecraft.sh elif [ "${gamename}" == "Mumble" ]; then update_mumble.sh else diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 52155dc49..e6e563fc7 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -44,7 +44,7 @@ fn_dl_md5(){ fi } -# Extracts bzip2 or gzip files +# Extracts bzip2 or gzip or zip files # Extracts can be defined in code like so: # fn_dl_extract "${filedir}" "${filename}" "${extractdir}" # fn_dl_extract "/home/gameserver/lgsm/tmp" "file.tar.bz2" "/home/gamserver/serverfiles" @@ -61,6 +61,8 @@ fn_dl_extract(){ tarcmd=$(tar -zxf "${filedir}/${filename}" -C "${extractdir}") elif [ "${mime}" == "application/x-bzip2" ]; then tarcmd=$(tar -jxf "${filedir}/${filename}" -C "${extractdir}") + elif [ "${mime}" == "application/zip" ]; then + tarcmd=$(unzip -d "${extractdir}" "${filedir}/${filename}") fi local exitcode=$? if [ ${exitcode} -ne 0 ]; then @@ -115,7 +117,7 @@ fn_fetch_file(){ # trap to remove part downloaded files trap fn_fetch_trap INT # if larger file shows progress bar - if [ ${filename##*.} == "bz2" ]; then + if [ ${filename##*.} == "bz2" ]||[ ${filename##*.} == "jar" ]; then echo -ne "downloading ${filename}..." sleep 1 curlcmd=$(${curlcmd} --progress-bar --fail -L -o "${filedir}/${filename}" "${fileurl}") diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index e1e6cbbc7..73f8bd44d 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -322,6 +322,10 @@ functionfile="${FUNCNAME}" fn_fetch_function } +fix_ut.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} # Info @@ -396,6 +400,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } +update_minecraft.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + update_mumble.sh(){ functionfile="${FUNCNAME}" fn_fetch_function @@ -451,6 +460,11 @@ functionfile="${FUNCNAME}" fn_fetch_function } +install_minecraft_eula.sh(){ +functionfile="${FUNCNAME}" +fn_fetch_function +} + install_retry.sh(){ functionfile="${FUNCNAME}" fn_fetch_function diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 4c6514bdd..26aa8ec7c 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -41,7 +41,7 @@ case "${getopt}" in command_install.sh;; ai|auto-install) fn_autoinstall;; - dd|depsdetect) + dd|deps-detect) command_dev_detect_deps.sh;; dg|detect-glibc) command_dev_detect_glibc.sh;; @@ -65,7 +65,7 @@ case "${getopt}" in echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." echo -e "${blue}monitor\t${default}m |Checks that the server is running." echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." echo -e "${blue}backup\t${default}b |Create archive of the server." echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." @@ -103,7 +103,7 @@ case "${getopt}" in command_install.sh;; ai|auto-install) fn_autoinstall;; - dd|depsdetect) + dd|deps-detect) command_dev_detect_deps.sh;; dg|detect-glibc) command_dev_detect_glibc.sh;; @@ -125,7 +125,7 @@ case "${getopt}" in echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." echo -e "${blue}monitor\t${default}m |Checks that the server is running." echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." echo -e "${blue}change-password\t${default}pw |Changes TS3 serveradmin password." echo -e "${blue}backup\t${default}b |Create archive of the server." echo -e "${blue}install\t${default}i |Install the server." @@ -134,6 +134,68 @@ case "${getopt}" in esac } +fn_getopt_minecraft(){ +case "${getopt}" in + st|start) + command_start.sh;; + sp|stop) + command_stop.sh;; + r|restart) + command_restart.sh;; + u|update) + command_update.sh;; + uf|update-functions) + command_update_functions.sh;; + m|monitor) + command_monitor.sh;; + ta|test-alert) + command_test_alert.sh;; + dt|details) + command_details.sh;; + b|backup) + command_backup.sh;; + c|console) + command_console.sh;; + d|debug) + command_debug.sh;; + dev|dev-debug) + command_dev_debug.sh;; + i|install) + command_install.sh;; + ai|auto-install) + fn_autoinstall;; + dd|deps-detect) + command_dev_detect_deps.sh;; + dg|detect-glibc) + command_dev_detect_glibc.sh;; + *) + if [ -n "${getopt}" ]; then + echo -e "${red}Unknown command${default}: $0 ${getopt}" + exitcode=2 + fi + echo "Usage: $0 [option]" + echo "${gamename} - Linux Game Server Manager - Version ${version}" + echo "https://gameservermanagers.com/${selfname}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + { + echo -e "${blue}start\t${default}st |Start the server." + echo -e "${blue}stop\t${default}sp |Stop the server." + echo -e "${blue}restart\t${default}r |Restart the server." + echo -e "${blue}update\t${default}u |Checks and applies updates from mojang.com." + echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." + echo -e "${blue}monitor\t${default}m |Checks that the server is running." + echo -e "${blue}test-alert\t${default}ta |Sends test alert." + echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." + echo -e "${blue}backup\t${default}b |Create archive of the server." + echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." + echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." + echo -e "${blue}install\t${default}i |Install the server." + echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts." + } | column -s $'\t' -t + esac +} + fn_getopt_mumble(){ case "${getopt}" in st|start) @@ -158,7 +220,7 @@ case "${getopt}" in command_dev_debug.sh;; i|install) command_install.sh;; - dd|depsdetect) + dd|deps-detect) command_dev_detect_deps.sh;; dg|detect-glibc) command_dev_detect_glibc.sh;; @@ -180,7 +242,7 @@ case "${getopt}" in echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." echo -e "${blue}monitor\t${default}m |Checks that the server is running." echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." echo -e "${blue}backup\t${default}b |Create archive of the server." echo -e "${blue}install\t${default}i |Install the server." } | column -s $'\t' -t @@ -222,7 +284,7 @@ case "${getopt}" in command_install.sh;; ai|auto-install) fn_autoinstall;; - dd|depsdetect) + dd|deps-detect) command_dev_detect_deps.sh;; dg|detect-glibc) command_dev_detect_glibc.sh;; @@ -248,7 +310,7 @@ case "${getopt}" in echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." echo -e "${blue}monitor\t${default}m |Checks that the server is running." echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." echo -e "${blue}backup\t${default}b |Create archive of the server." echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." @@ -289,7 +351,7 @@ case "${getopt}" in fn_autoinstall;; mc|map-compressor) compress_ut99_maps.sh;; - dd|depsdetect) + dd|deps-detect) command_dev_detect_deps.sh;; dg|detect-glibc) command_dev_detect_glibc.sh;; @@ -310,7 +372,7 @@ case "${getopt}" in echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." echo -e "${blue}monitor\t${default}m |Checks that the server is running." echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." echo -e "${blue}backup\t${default}b |Create archive of the server." echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." @@ -357,7 +419,7 @@ case "${getopt}" in command_install.sh;; ai|auto-install) fn_autoinstall;; - dd|depsdetect) + dd|deps-detect) command_dev_detect_deps.sh;; dg|detect-glibc) command_dev_detect_glibc.sh;; @@ -383,7 +445,7 @@ case "${getopt}" in echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD." echo -e "${blue}monitor\t${default}m |Checks that the server is running." echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." echo -e "${blue}backup\t${default}b |Create archive of the server." echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." @@ -427,7 +489,7 @@ case "${getopt}" in install_ut2k4_key.sh;; mc|map-compressor) compress_unreal2_maps.sh;; - dd|depsdetect) + dd|deps-detect) command_dev_detect_deps.sh;; dg|detect-glibc) command_dev_detect_glibc.sh;; @@ -448,7 +510,7 @@ case "${getopt}" in echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded." echo -e "${blue}monitor\t${default}m |Checks that the server is running." echo -e "${blue}test-alert\t${default}ta |Sends test alert." - echo -e "${blue}details\t${default}dt |Displays useful infomation about the server." + echo -e "${blue}details\t${default}dt |Displays useful information about the server." echo -e "${blue}backup\t${default}b |Create archive of the server." echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server." echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal." @@ -462,6 +524,8 @@ case "${getopt}" in if [ "${gamename}" == "Mumble" ]; then fn_getopt_mumble +elif [ "${engine}" == "lwjgl2" ]; then + fn_getopt_minecraft elif [ "${gamename}" == "TeamSpeak 3" ]; then fn_getopt_teamspeak3 elif [ "${gamename}" == "Garry's Mod" ]; then diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 97f609f50..d23733cde 100644 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -249,13 +249,13 @@ fn_print_warning_nl(){ echo -e "${yellow}Warning!${default} $@" } -# Infomation! -fn_print_infomation(){ - echo -en "${cyan}Infomation!${default} $@" +# Information! +fn_print_information(){ + echo -en "${cyan}Information!${default} $@" } -fn_print_infomation_nl(){ - echo -e "${cyan}Infomation!${default} $@" +fn_print_information_nl(){ + echo -e "${cyan}Information!${default} $@" } # On-Screen End of Line diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index f31c010d7..0178b363c 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -72,5 +72,11 @@ if [ "${function_selfname}" == "command_install.sh" ]; then echo "=================================" sleep 1 fix_ut99.sh + elif [ "${gamename}" == "Unreal Tournament" ]; then + echo "" + echo "Applying ${gamename} Server Fixes" + echo "=================================" + sleep 1 + fix_ut.sh fi fi diff --git a/lgsm/functions/fix_ut.sh b/lgsm/functions/fix_ut.sh new file mode 100644 index 000000000..74233406f --- /dev/null +++ b/lgsm/functions/fix_ut.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# LGSM fix_ut.sh function +# Author: Alexander Hurd +# Website: https://gameservermanagers.com +# Description: Resolves various issues with Unreal Tournament. + +local commandname="FIX" +local commandaction="Fix" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" + +#Set Binary Executable +echo "chmod +x ${executabledir}/${executable}" +chmod +x "${executabledir}/${executable}" +sleep 1 \ No newline at end of file diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 1f754d62d..6c868d047 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -10,7 +10,7 @@ local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" ## Examples of filtering to get info from config files # sed 's/foo//g' - remove foo # tr -cd '[:digit:]' leave only digits -# tr -d '=\"; ' remove selected charectors =\"; +# tr -d '=\"; ' remove selected characters =\"; # grep -v "foo" filter out lines that contain foo unavailable="${red}UNAVAILABLE${default}" @@ -68,6 +68,37 @@ fn_info_config_dontstarve(){ fi } +fn_info_config_minecraft(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + rconport="${zero}" + slots="${zero}" + port="${zero}" + gamemode="${zero}" + gameworld="${unavailable}" + else + # check if the ip exists in the config file. Failing this will fall back to the default. + ipconfigcheck=$(grep "server-ip=" "${servercfgfullpath}" | sed 's/server-ip=//g') + if [ -n "${ipconfigcheck}" ]; then + ip="${ipconfigcheck}" + fi + rconpassword=$(grep "rcon.password=" "${servercfgfullpath}" | sed 's/rcon.password=//g' | tr -d '=\"; ') + rconport=$(grep "rcon.port=" "${servercfgfullpath}" | tr -cd '[:digit:]') + slots=$(grep "max-players=" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "server-port=" "${servercfgfullpath}" | tr -cd '[:digit:]') + gamemode=$(grep "gamemode=" "${servercfgfullpath}" | tr -cd '[:digit:]') + gameworld=$(grep "level-name=" "${servercfgfullpath}" | sed 's/level-name=//g' | tr -d '=\"; ') + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"NOT SET"} + slots=${slots:-"NOT SET"} + port=${port:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} + fi +} + fn_info_config_projectzomboid(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -77,9 +108,9 @@ fn_info_config_projectzomboid(){ port="${zero}" gameworld="${unavailable}" else - 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 '\') + servername=$(grep "PublicName=" "${servercfgfullpath}" | sed 's/PublicName=//g' | tr -d '=\";\n') + 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') @@ -374,18 +405,22 @@ fn_info_config_sdtd(){ gameworld=${gameworld:-"NOT SET"} fi } -## Just Cause 2 + +# Just Cause 2 if [ "${engine}" == "avalanche" ]; then fn_info_config_avalanche -## Dont Starve Together +# Dont Starve Together elif [ "${engine}" == "dontstarve" ]; then fn_info_config_dontstarve -## Project Zomboid -elif [ "${engine}" == "projectzomboid" ]; then - fn_info_config_projectzomboid # Quake Love elif [ "${engine}" == "idtech3" ]; then fn_info_config_idtech3 +# Minecraft +elif [ "${engine}" == "lwjgl2" ]; then + fn_info_config_minecraft +# Project Zomboid +elif [ "${engine}" == "projectzomboid" ]; then + fn_info_config_projectzomboid # ARMA 3 elif [ "${engine}" == "realvirtuality" ]; then fn_info_config_realvirtuality diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 4f3012730..a203a2c47 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -7,7 +7,7 @@ local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" -### Distro infomation +### Distro information ## Distro # Returns architecture, kernel and distro/os. @@ -53,12 +53,12 @@ hours=$(( uptime/60/60%24 )) days=$(( uptime/60/60/24 )) -### Performance infomation +### Performance information ## Average server load load=$(uptime|awk -F 'load average: ' '{ print $2 }') -## Memory Infomation +## Memory information # Available RAM and swap. # Older versions of free do not support -h option. @@ -77,7 +77,7 @@ swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}') swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}') swapfree=$(free ${humanreadable} | awk '/Swap:/ {print $4}') -### Disk Infomation +### Disk information ## Available disk space on the partition. filesystem=$(df -hP "${rootdir}" | grep -v "Filesystem" | awk '{print $1}') diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh index 2a2f289bc..a1916944f 100644 --- a/lgsm/functions/info_glibc.sh +++ b/lgsm/functions/info_glibc.sh @@ -29,18 +29,27 @@ elif [ "${gamename}" == "Garry's Mod" ]; then elif [ "${gamename}" == "Insurgency" ]; then glibcrequired="2.15" glibcfix="yes" +elif [ "${gamename}" == "Mumble" ]; then + glibcrequired="NOT REQUIRED" + glibcfix="no" elif [ "${gamename}" == "No More Room in Hell" ]; then glibcrequired="2.15" glibcfix="yes" elif [ "${gamename}" == "Quake Live" ]; then glibcrequired="2.15" glibcfix="no" +elif [ "${gamename}" == "TeamSpeak 3" ]; then + glibcrequired="NOT REQUIRED" + glibcfix="no" elif [ "${engine}" == "avalanche" ]; then glibcrequired="2.13" glibcfix="yes" elif [ "${engine}" == "dontstarve" ]; then glibcrequired="2.15" glibcfix="no" +elif [ "${engine}" == "lwjgl2" ]; then + glibcrequired="NOT REQUIRED" + glibcfix="no" elif [ "${engine}" == "projectzomboid" ]; then glibcrequired="2.15" glibcfix="no" @@ -68,6 +77,9 @@ elif [ "${engine}" == "unreal" ]; then elif [ "${engine}" == "unreal2" ]; then glibcrequired="2.4" glibcfix="no" +elif [ "${engine}" == "unreal3" ]; then + glibcrequired="2.3.2" + glibcfix="no" elif [ "${engine}" == "unreal4" ]; then glibcrequired="2.14" glibcfix="no" @@ -80,6 +92,12 @@ elif [ "${gamename}" == "TeamSpeak 3" ]; then elif [ "${gamename}" == "Mumble" ]; then glibcrequired="NOT REQUIRED" glibcfix="no" +elif [ "${engine}" == "idtech3" ]; then + glibcrequired="2.0" + glibcfix="no" +elif [ "${engine}" == "refractor" ]; then + glibcrequired="2.0" + glibcfix="no" else glibcrequired="UNKNOWN" glibcfix="no" diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 90ebb2ff1..1aafd1602 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -36,7 +36,7 @@ fn_userinputconfig(){ fn_script_log_info "changing rconpassword." sed -i "s/\"\"/\"${rconpass}\"/g" "${servercfgfullpath}" sleep 1 - } +} fn_arma3config(){ fn_defaultconfig @@ -165,6 +165,57 @@ fn_unreal2config(){ echo "" } +fn_ut3config(){ + echo "" + echo "Configuring ${gamename} Server" + echo "=================================" + sleep 1 + echo "setting ServerName to 'LinuxGSM UT3 Server'." + fn_script_log_info "setting ServerName to 'LinuxGSM UT3 Server'." + sleep 1 + sed -i 's/ServerName=/ServerName=LinuxGSM UT3 Server/g' "${servercfgdir}/DefaultGame.ini" + echo "setting WebAdmin password to admin." + fn_script_log_info "setting WebAdmin password to admin." + echo '[Engine.AccessControl]' >> "${servercfgdir}/DefaultGame.ini" + echo 'AdminPassword=admin' >> "${servercfgdir}/DefaultGame.ini" + sleep 1 + echo "enabling WebAdmin." + fn_script_log_info "enabling WebAdmin." + sed -i 's/bEnabled=false/bEnabled=True/g' "${servercfgdir}/DefaultWeb.ini" + if [ "${gamename}" == "Unreal Tournament 3" ]; then + sleep 1 + echo "setting WebAdmin port to 8081." + fn_script_log_info "setting WebAdmin port to 8081." + sed -i 's/ListenPort=80/ListenPort=8081/g' "${servercfgdir}/DefaultWeb.ini" + fi + sleep 1 + echo "" +} + +fn_unrealtournament(){ + # allow user to input server name and password + if [ -z "${autoinstall}" ]; then + echo "" + echo "Configuring ${gamename} Server" + echo "=================================" + sleep 1 + read -p "Enter server name: " servername + read -p "Enter rcon password: " rconpass + else + servername="${servicename}" + rconpass="rconpassword" + fi + echo "changing hostname." + fn_script_log_info "changing hostname." + sed -i "s/\"\"/\"${servername}\"/g" "${servercfgdir}/Game.ini" + sleep 1 + echo "changing rconpassword." + fn_script_log_info "changing rconpassword." + sed -i "s/\"\"/\"${rconpass}\"/g" "${servercfgdir}/Engine.ini" + sleep 1 + +} + echo "" if [ "${gamename}" != "Hurtworld" ]; then echo "Creating Configs" @@ -257,6 +308,13 @@ elif [ "${gamename}" == "Double Action: Boogaloo" ]; then fn_sourceconfig elif [ "${gamename}" == "Empires Mod" ]; then fn_defaultconfig +elif [ "${gamename}" == "Enemy Territory" ]; then + echo -e "downloading lgsm-default.cfg...\c" + wget -N /dev/null ${githuburl}/EnemyTerritory/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq + sleep 1 + fn_defaultconfig + fn_userinputconfig + echo "" elif [ "${gamename}" == "Fistful of Frags" ]; then echo -e "downloading lgsm-default.cfg...\c" wget -N /dev/null ${githuburl}/FistfulOfFrags/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq @@ -301,6 +359,11 @@ elif [ "${gamename}" == "Left 4 Dead 2" ]; then wget -N /dev/null ${githuburl}/Left4Dead2/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq sleep 1 fn_sourceconfig +elif [ "${gamename}" == "Minecraft" ]; then + echo -e "downloading lgsm-default.ini...\c" + wget -N /dev/null ${githuburl}/Minecraft/cfg/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq + sleep 1 + fn_defaultconfig elif [ "${gamename}" == "No More Room in Hell" ]; then echo -e "downloading lgsm-default.cfg...\c" wget -N /dev/null ${githuburl}/NoMoreRoomInHell/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq @@ -382,6 +445,15 @@ elif [ "${gamename}" == "Terraria" ]; then wget -N /dev/null ${githuburl}/Terraria/cfg/lgsm-default.txt 2>&1 | grep -F HTTP | cut -c45- | uniq sleep 1 fn_defaultconfig +elif [ "${gamename}" == "Unreal Tournament" ]; then + echo -e "downloading Engine.ini...\c" + wget -N /dev/null ${githuburl}/UnrealTournament/cfg/Engine.ini 2>&1 | grep -F HTTP | cut -c45- | uniq + echo -e "downloading Game.ini...\c" + wget -N /dev/null ${githuburl}/UnrealTournament/cfg/Game.ini 2>&1 | grep -F HTTP | cut -c45- | uniq + sleep 1 + fn_unrealtournament +elif [ "${gamename}" == "Unreal Tournament 3" ]; then + fn_ut3config elif [ "${gamename}" == "Unreal Tournament 2004" ]; then fn_unreal2config elif [ "${gamename}" == "Unreal Tournament 99" ]; then diff --git a/lgsm/functions/install_gslt.sh b/lgsm/functions/install_gslt.sh index f0a706830..3bbe063e0 100644 --- a/lgsm/functions/install_gslt.sh +++ b/lgsm/functions/install_gslt.sh @@ -12,7 +12,7 @@ echo "" echo "Game Server Login Token" echo "=================================" sleep 1 -if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then +if [ "${gamename}" == "Counter Strike: Global Offensive" ]||[ "${gamename}" == "Counter Strike: Source" ]; then echo "GSLT is required to run a public ${gamename} server" fn_script_log_info "GSLT is required to run a public ${gamename} server" else diff --git a/lgsm/functions/install_minecraft_eula.sh b/lgsm/functions/install_minecraft_eula.sh new file mode 100644 index 000000000..410e283b4 --- /dev/null +++ b/lgsm/functions/install_minecraft_eula.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# LGSM install_minecraft_eula.sh function +# Author: Daniel Gibbs +# Website: https://gameservermanagers.com +# Description: Gets user to accept the EULA. + +echo "" +echo "Accept ${gamename} EULA" +echo "=================================" +sleep 1 +echo "You are required to accept the EULA:" +echo "https://account.mojang.com/documents/minecraft_eula" + +echo "eula=false" > "${filesdir}/eula.txt" + +if [ -z "${autoinstall}" ]; then +echo "By continuing you are indicating your agreement to the EULA." +echo "" + while true; do + read -e -i "y" -p "Continue [Y/n]" yn + case $yn in + [Yy]* ) break;; + [Nn]* ) core_exit.sh;; + * ) echo "Please answer yes or no.";; + esac + done +else +echo "By using auto-install you are indicating your agreement to the EULA." +echo "" + sleep 5 +fi + +sed -i "s/eula=false/eula=true/g" "${filesdir}/eula.txt" \ No newline at end of file diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 8f05a01a8..d26efd2cb 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -13,6 +13,14 @@ fn_install_server_files(){ fileurl="https://gameservermanagers.com/files/UnrealTournament99/ut99-server-451-ultimate-linux.tar.bz2"; filedir="${lgsmdir}/tmp"; filename="ut99-server-451-ultimate-linux.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="49cb24d0550ff6ddeaba6007045c6edd" elif [ "${gamename}" == "Unreal Tournament 2004" ]; then fileurl="https://gameservermanagers.com/files/UnrealTournament2004/ut2004-server-3339-ultimate-linux.tar.bz2"; filedir="${lgsmdir}/tmp"; filename="ut2004-server-3339-ultimate-linux.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="67c5e2cd9c2a4b04f163962ee41eff54" + elif [ "${gamename}" == "Unreal Tournament 3" ]; then + fileurl="https://s3.amazonaws.com/linuxgsm/UT3-linux-server-2.1.tar.gz"; filedir="${lgsmdir}/tmp"; filename="UT3-linux-server-2.1.tar.gz"; executecmd="noexecute" run="norun"; force="noforce"; md5="6c22fcef9e2e03ed154df97569af540c" + elif [ "${gamename}" == "Battlefield: 1942" ]; then + fileurl="https://s3.amazonaws.com/linuxgsm/bf1942_lnxded-1.61-hacked-to-1.612.full.tar.gz"; filedir="${lgsmdir}/tmp"; filename="bf1942_lnxded-1.61-hacked-to-1.612.full.tar.gz"; executecmd="noexecute" run="norun"; force="noforce"; md5="7e9d2538a62b228f2de7176b44659aa9" + elif [ "${gamename}" == "Enemy Territory" ]; then + fileurl="https://s3.amazonaws.com/linuxgsm/enemy-territory.260b.tar.gz"; filedir="${lgsmdir}/tmp"; filename="enemy-territory.260b.tar.gz"; executecmd="noexecute" run="norun"; force="noforce"; md5="ded32053e470fe15d9403ec4a0ab7e89" + elif [ "${gamename}" == "Unreal Tournament" ]; then + fileurl="https://s3.amazonaws.com/unrealtournament/UnrealTournament-Server-XAN-3045522-Linux.zip"; filedir="${lgsmdir}/tmp"; filename="UnrealTournament-Server-XAN-3045522-Linux.zip"; executecmd="noexecute" run="norun"; force="noforce"; md5="553fed5645a9fc623e92563049bf79f6" elif [ "${gamename}" == "GoldenEye: Source" ]; then fileurl="https://gameservermanagers.com/files/GoldenEyeSource/goldenEye_source_v4.2.4_server_2015_map_pack.tar.bz2"; filedir="${lgsmdir}/tmp"; filename="goldenEye_source_v4.2.4_server_2015_map_pack.tar.bz2"; executecmd="noexecute" run="norun"; force="noforce"; md5="3148ac38acc3642b0d6d64f51f27de15" fi @@ -78,7 +86,7 @@ fn_install_server_files_steamcmd(){ # Goldsource servers commonly fail to download all the server files required. # Validating a few of times may reduce the chance of this issue. if [ "${engine}" == "goldsource" ]; then - fn_print_infomation_nl "Goldsource servers commonly fail to download all the server files required. Validating a few of times may reduce the chance of this issue." + fn_print_information_nl "Goldsource servers commonly fail to download all the server files required. Validating a few of times may reduce the chance of this issue." counter="0" while [ "${counter}" -le "4" ]; do counter=$((counter+1)) @@ -95,6 +103,9 @@ sleep 1 if [ "${gamename}" == "TeamSpeak 3" ]; then update_ts3.sh +elif [ "${gamename}" == "Minecraft" ]; then + update_minecraft.sh + install_minecraft_eula.sh elif [ "${gamename}" == "Mumble" ]; then update_mumble.sh elif [ -z "${appid}" ]||[ "${gamename}" == "GoldenEye: Source" ]; then diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh new file mode 100644 index 000000000..f4e140d6e --- /dev/null +++ b/lgsm/functions/update_minecraft.sh @@ -0,0 +1,157 @@ +#!/bin/bash +# LGSM update_minecraft.sh function +# Author: Daniel Gibbs +# Website: https://gameservermanagers.com +# Description: Handles updating of Minecraft servers. + +local commandname="UPDATE" +local commandaction="Update" +local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" + +fn_update_dl(){ + fn_fetch_file "https://s3.amazonaws.com/Minecraft.Download/versions/${availablebuild}/minecraft_server.${availablebuild}.jar" "${lgsmdir}/tmp" "minecraft_server.${availablebuild}.jar" + echo -e "copying to ${filesdir}...\c" + fn_script_log "Copying to ${filesdir}" + cp "${lgsmdir}/tmp/minecraft_server.${availablebuild}.jar" "${filesdir}/minecraft_server.jar" + local exitcode=$? + if [ ${exitcode} -eq 0 ]; then + fn_print_ok_eol_nl + else + fn_print_fail_eol_nl + fi +} + +fn_update_currentbuild(){ + # Gets current build info + # Checks if current build info is available. If it fails, then a server restart will be forced to generate logs. + if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then + fn_print_error "Checking for update: mojang.com" + sleep 1 + fn_print_error_nl "Checking for update: mojang.com: No logs with server version found" + fn_script_log_error "Checking for update: mojang.com: No logs with server version found" + sleep 1 + fn_print_info_nl "Checking for update: mojang.com: Forcing server restart" + fn_script_log_info "Checking for update: mojang.com: Forcing server restart" + sleep 1 + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + sleep 1 + # Check again and exit on failure. + if [ ! -f "${consolelogdir}/${servicename}-console.log" ]; then + fn_print_fail_nl "Checking for update: mojang.com: Still No logs with server version found" + fn_script_log_fatal "Checking for update: mojang.com: Still No logs with server version found" + core_exit.sh + fi + fi + + # Get current build from logs + currentbuild=$(cat "${filesdir}/logs/latest.log" 2> /dev/null | grep version | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') + if [ -z "${currentbuild}" ]; then + fn_print_error_nl "Checking for update: mojang.com: Current build version not found" + fn_script_log_error "Checking for update: mojang.com: Current build version not found" + sleep 1 + fn_print_info_nl "Checking for update: mojang.com: Forcing server restart" + fn_script_log_info "Checking for update: mojang.com: Forcing server restart" + exitbypass=1 + command_stop.sh + exitbypass=1 + command_start.sh + currentbuild=$(cat "${filesdir}/logs/latest.log" 2> /dev/null | grep version | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') + if [ -z "${currentbuild}" ]; then + fn_print_fail_nl "Checking for update: mojang.com: Current build version still not found" + fn_script_log_fatal "Checking for update: mojang.com: Current build version still not found" + core_exit.sh + fi + fi +} + +fn_update_availablebuild(){ + # Gets latest build info. + availablebuild=$(curl -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | sed -e 's/^.*"release":"\([^"]*\)".*$/\1/') + sleep 1 + + # Checks if availablebuild variable has been set + if [ -z "${availablebuild}" ]; then + fn_print_fail "Checking for update: mojang.com" + sleep 1 + fn_print_fail "Checking for update: mojang.com: Not returning version info" + fn_script_log_fatal "Failure! Checking for update: mojang.com: Not returning version info" + core_exit.sh + else + fn_print_ok_nl "Checking for update: mojang.com" + fn_script_log_pass "Checking for update: mojang.com" + sleep 1 + fi +} + +fn_update_compare(){ + # Removes dots so if can compare version numbers + currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]') + availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]') + + if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then + echo -e "\n" + echo -e "Update available:" + sleep 1 + echo -e " Current build: ${red}${currentbuild}${default}" + echo -e " Available build: ${green}${availablebuild}${default}" + echo -e "" + sleep 1 + echo "" + echo -en "Applying update.\r" + sleep 1 + echo -en "Applying update..\r" + sleep 1 + echo -en "Applying update...\r" + sleep 1 + echo -en "\n" + fn_script_log "Update available" + fn_script_log "Current build: ${currentbuild}" + fn_script_log "Available build: ${availablebuild}" + fn_script_log "${currentbuild} > ${availablebuild}" + + unset updateonstart + + check_status.sh + if [ "${status}" == "0" ]; then + fn_update_dl + exitbypass=1 + command_start.sh + exitbypass=1 + command_stop.sh + else + exitbypass=1 + command_stop.sh + fn_update_dl + exitbypass=1 + command_start.sh + fi + alert="update" + alert.sh + else + echo -e "\n" + echo -e "No update available:" + echo -e " Current version: ${green}${currentbuild}${default}" + echo -e " Available version: ${green}${availablebuild}${default}" + echo -e "" + fn_print_ok_nl "No update available" + fn_script_log_info "Current build: ${currentbuild}" + fn_script_log_info "Available build: ${availablebuild}" + fi +} + + +if [ "${installer}" == "1" ]; then + fn_update_availablebuild + fn_update_dl +else + # Checks for server update from mojang.com + fn_print_dots "Checking for update: mojang.com" + fn_script_log_info "Checking for update: mojang.com" + sleep 1 + fn_update_currentbuild + fn_update_availablebuild + fn_update_compare +fi diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index ba4b6f3ce..0a90384f7 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -87,7 +87,7 @@ fn_update_mumble_availablebuild(){ fn_script_log_fatal "Failure! Checking for update: GitHub: Not returning version info" core_exit.sh else - fn_print_ok_nl "Checking for update: GitHub" + fn_print_ok "Checking for update: GitHub" fn_script_log_pass "Checking for update: GitHub" sleep 1 fi diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index 9a6599942..6dfdced1a 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -119,7 +119,7 @@ fn_update_ts3_availablebuild(){ fn_script_log_fatal "Failure! Checking for update: teamspeak.com: Not returning version info" core_exit.sh else - fn_print_ok_nl "Checking for update: teamspeak.com" + fn_print_ok "Checking for update: teamspeak.com" fn_script_log_pass "Checking for update: teamspeak.com" sleep 1 fi diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 7522cd0fe..c5f69f734 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -41,8 +41,8 @@ parms="" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="$TRAVIS_BRANCH" # Steam diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index d3406022b..fb416d633 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -37,8 +37,8 @@ parms="" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="dgibbs64" -githubrepo="linuxgsm" +githubuser="GameServerManagers" +githubrepo="LinuxGSM" githubbranch="$TRAVIS_BRANCH" # Server Details