From 17f8c787c2a3840804bc76f57babe2ac588c839c Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 05:44:34 -0400 Subject: [PATCH 01/13] adding Unreal Tournament --- UnrealTournament/cfg/Engine.ini | 3 + UnrealTournament/uthubserver | 142 ++++++++++++++++++++++++ UnrealTournament/utserver | 144 +++++++++++++++++++++++++ lgsm/functions/command_install.sh | 2 +- lgsm/functions/install_config.sh | 8 ++ lgsm/functions/install_server_files.sh | 2 + 6 files changed, 300 insertions(+), 1 deletion(-) create mode 100644 UnrealTournament/cfg/Engine.ini create mode 100644 UnrealTournament/uthubserver create mode 100644 UnrealTournament/utserver diff --git a/UnrealTournament/cfg/Engine.ini b/UnrealTournament/cfg/Engine.ini new file mode 100644 index 000000000..b9db58305 --- /dev/null +++ b/UnrealTournament/cfg/Engine.ini @@ -0,0 +1,3 @@ +[/Script/UnrealTournament.UTGameEngine] +bFirstRun=False +RconPassword= diff --git a/UnrealTournament/uthubserver b/UnrealTournament/uthubserver new file mode 100644 index 000000000..b4119139c --- /dev/null +++ b/UnrealTournament/uthubserver @@ -0,0 +1,142 @@ +#!/bin/bash +# Unreal Tournament Hub +# 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="UnrealTournament UT-Entry?Game=Lobby -port=${port}" +} + +#### 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="ut-hub-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}" +executabledir="${systemdir}/LinuxServer/Engine/Binaries/Linux" +executable="./UE4Server-Linux-Shipping" +servercfg="Game.ini" +servercfgdir="${systemdir}/UnrealTournament/Saved/Config/LinuxServer" +servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/Game.ini" +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/UnrealTournament/utserver b/UnrealTournament/utserver new file mode 100644 index 000000000..44a32ff75 --- /dev/null +++ b/UnrealTournament/utserver @@ -0,0 +1,144 @@ +#!/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 +ip="0.0.0.0" +port="7777" + +fn_parms(){ +parms="UnrealTournament DM-DeckTest?Game=DM?TimeLimit=10 -port=${port}" +#parms="UnrealTournament CTF-FaceTest?Game=CTF?TimeLimit=15 -port=${port}" +} + +#### 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="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}" +executabledir="${systemdir}/LinuxServer/Engine/Binaries/Linux" +executable="./UE4Server-Linux-Shipping" +servercfg="Game.ini" +servercfgdir="${systemdir}/UnrealTournament/Saved/Config/LinuxServer" +servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/Game.ini" +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/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index ac66e96e4..8af67e12a 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -18,7 +18,7 @@ check_deps.sh if [ "${gamename}" == "Unreal Tournament 2004" ]; then install_server_files.sh install_ut2k4_key.sh -elif [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]; then +elif [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]; then installer=1 install_server_files.sh elif [ -n "${appid}" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 90ebb2ff1..0b93a02d7 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -165,6 +165,12 @@ fn_unreal2config(){ echo "" } +fn_unreal4(){ + echo "" + echo "Configuring ${gamename} Server" + echo "=================================" +} + echo "" if [ "${gamename}" != "Hurtworld" ]; then echo "Creating Configs" @@ -382,6 +388,8 @@ 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 + fn_unreal4 elif [ "${gamename}" == "Unreal Tournament 2004" ]; then fn_unreal2config elif [ "${gamename}" == "Unreal Tournament 99" ]; then diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 8f05a01a8..fc6969749 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -13,6 +13,8 @@ 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" ]; 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 From 13b18a59168a53a7dc5e6b8f4d556ee3d5abc5f2 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 06:11:37 -0400 Subject: [PATCH 02/13] adding unzip functionality --- lgsm/functions/check_deps.sh | 7 +++++++ lgsm/functions/core_dl.sh | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 57f432ec4..165c129d6 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -188,6 +188,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 @@ -243,6 +246,10 @@ 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 fi fn_deps_email fn_check_loop diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 52155dc49..0c1e0a76b 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 From 0a2634583d52eeabb1dcb7be7d63784b6856fbcf Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 06:14:31 -0400 Subject: [PATCH 03/13] fix --- lgsm/functions/check_deps.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 165c129d6..b45f24faa 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -250,7 +250,6 @@ elif [ -n "$(command -v yum)" ]; then elif [ "${gamename}" == "Unreal Tournament" ]; then array_deps_required+=( unzip ) fi - fi fn_deps_email fn_check_loop fi From fecbba7619d8cba1fa485667997171659028c357 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 06:25:17 -0400 Subject: [PATCH 04/13] path fix --- UnrealTournament/uthubserver | 4 ++-- UnrealTournament/utserver | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/UnrealTournament/uthubserver b/UnrealTournament/uthubserver index b4119139c..908161fad 100644 --- a/UnrealTournament/uthubserver +++ b/UnrealTournament/uthubserver @@ -54,8 +54,8 @@ lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${systemdir}/LinuxServer/Engine/Binaries/Linux" +systemdir="${filesdir}/LinuxServer" +executabledir="${systemdir}/Engine/Binaries/Linux" executable="./UE4Server-Linux-Shipping" servercfg="Game.ini" servercfgdir="${systemdir}/UnrealTournament/Saved/Config/LinuxServer" diff --git a/UnrealTournament/utserver b/UnrealTournament/utserver index 44a32ff75..a2e48d6c5 100644 --- a/UnrealTournament/utserver +++ b/UnrealTournament/utserver @@ -56,8 +56,8 @@ lgsmdir="${rootdir}/lgsm" functionsdir="${lgsmdir}/functions" libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${systemdir}/LinuxServer/Engine/Binaries/Linux" +systemdir="${filesdir}/LinuxServer" +executabledir="${systemdir}/Engine/Binaries/Linux" executable="./UE4Server-Linux-Shipping" servercfg="Game.ini" servercfgdir="${systemdir}/UnrealTournament/Saved/Config/LinuxServer" From 97f3e63c8cf1636318ce82b33ce5286fe86011f7 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 06:37:19 -0400 Subject: [PATCH 05/13] adding UT fix --- lgsm/functions/fix.sh | 8 ++++++++ lgsm/functions/fix_ut.sh | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 lgsm/functions/fix_ut.sh diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index f31c010d7..365809b9b 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -43,6 +43,8 @@ if [ "${function_selfname}" != "command_install.sh" ]; then fix_ins.sh elif [ "${gamename}" == "ARMA 3" ]; then fix_arma3.sh + elif [ "${gamename}" == "ARMA 3" ]; then + fix_ut.sh fi fi @@ -72,5 +74,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 From e4b7c985e1709a2fb382d0fee72e03b1ea96bc7b Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 07:03:06 -0400 Subject: [PATCH 06/13] fix --- lgsm/functions/fix.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 365809b9b..0178b363c 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -43,8 +43,6 @@ if [ "${function_selfname}" != "command_install.sh" ]; then fix_ins.sh elif [ "${gamename}" == "ARMA 3" ]; then fix_arma3.sh - elif [ "${gamename}" == "ARMA 3" ]; then - fix_ut.sh fi fi From fb4f8dab6cf982f242a27d124b2201d0eed16aa1 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 07:12:55 -0400 Subject: [PATCH 07/13] adding fix_ut function --- lgsm/functions/core_functions.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index e1e6cbbc7..d178f6eb3 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 From eecb4753cbd583053e929bc0871fa97fdbd8f0d3 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 07:37:53 -0400 Subject: [PATCH 08/13] adding Engine.ini --- lgsm/functions/install_config.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 0b93a02d7..585eed52c 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -169,6 +169,7 @@ fn_unreal4(){ echo "" echo "Configuring ${gamename} Server" echo "=================================" + sed -i "s/\"\"/\"${rconpass}\"/g" "${servercfgdir}/Engine.ini" } echo "" @@ -389,6 +390,9 @@ elif [ "${gamename}" == "Terraria" ]; then 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 + sleep 1 fn_unreal4 elif [ "${gamename}" == "Unreal Tournament 2004" ]; then fn_unreal2config From 5440269e6714186b8d5fadea513eb8c06bc9ac66 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 08:23:58 -0400 Subject: [PATCH 09/13] adding UT configs --- UnrealTournament/cfg/Engine.ini | 2 +- UnrealTournament/cfg/Game.ini | 4 ++++ UnrealTournament/utserver | 8 ++++++-- lgsm/functions/install_config.sh | 31 +++++++++++++++++++++++++------ 4 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 UnrealTournament/cfg/Game.ini diff --git a/UnrealTournament/cfg/Engine.ini b/UnrealTournament/cfg/Engine.ini index b9db58305..177eaafdb 100644 --- a/UnrealTournament/cfg/Engine.ini +++ b/UnrealTournament/cfg/Engine.ini @@ -1,3 +1,3 @@ [/Script/UnrealTournament.UTGameEngine] bFirstRun=False -RconPassword= +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 index a2e48d6c5..57abe8dda 100644 --- a/UnrealTournament/utserver +++ b/UnrealTournament/utserver @@ -26,12 +26,16 @@ pushbulletalert="off" pushbullettoken="accesstoken" # Start Variables +defaultmap="DM-Underland" +gametype="DM" +#defaultmap="CTF-FaceTest" +#gametype="CTF" +timelimit="10" ip="0.0.0.0" port="7777" fn_parms(){ -parms="UnrealTournament DM-DeckTest?Game=DM?TimeLimit=10 -port=${port}" -#parms="UnrealTournament CTF-FaceTest?Game=CTF?TimeLimit=15 -port=${port}" +parms="UnrealTournament ${defaultmap}?Game=${gametype}?TimeLimit=${timelimit} -port=${port}" } #### Advanced Variables #### diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 585eed52c..2b0828b9e 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,11 +165,28 @@ fn_unreal2config(){ echo "" } -fn_unreal4(){ - echo "" - echo "Configuring ${gamename} Server" - 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 "" @@ -392,8 +409,10 @@ elif [ "${gamename}" == "Terraria" ]; then 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 dm.cfg...\c" + wget -N /dev/null ${githuburl}/UnrealTournament/cfg/Game.ini 2>&1 | grep -F HTTP | cut -c45- | uniq sleep 1 - fn_unreal4 + fn_unrealtournament elif [ "${gamename}" == "Unreal Tournament 2004" ]; then fn_unreal2config elif [ "${gamename}" == "Unreal Tournament 99" ]; then From ce9c70a7077db426bf9b355a7d3a2a980f7da8be Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 08:29:53 -0400 Subject: [PATCH 10/13] typo --- lgsm/functions/install_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 2b0828b9e..ecc264ea2 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -409,7 +409,7 @@ elif [ "${gamename}" == "Terraria" ]; then 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 dm.cfg...\c" + 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 From b631c87b09de9f2186855ce4a884de90f9023310 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 08:41:40 -0400 Subject: [PATCH 11/13] fix map name --- UnrealTournament/utserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnrealTournament/utserver b/UnrealTournament/utserver index 57abe8dda..8f1bb6498 100644 --- a/UnrealTournament/utserver +++ b/UnrealTournament/utserver @@ -28,7 +28,7 @@ pushbullettoken="accesstoken" # Start Variables defaultmap="DM-Underland" gametype="DM" -#defaultmap="CTF-FaceTest" +#defaultmap="CTF-Face" #gametype="CTF" timelimit="10" ip="0.0.0.0" From 5d81635e834ce74fb657e7930ac4e84c10823421 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 08:42:46 -0400 Subject: [PATCH 12/13] removing file --- UnrealTournament/uthubserver | 142 ----------------------------------- 1 file changed, 142 deletions(-) delete mode 100644 UnrealTournament/uthubserver diff --git a/UnrealTournament/uthubserver b/UnrealTournament/uthubserver deleted file mode 100644 index 908161fad..000000000 --- a/UnrealTournament/uthubserver +++ /dev/null @@ -1,142 +0,0 @@ -#!/bin/bash -# Unreal Tournament Hub -# 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="UnrealTournament UT-Entry?Game=Lobby -port=${port}" -} - -#### 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="ut-hub-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}" -servercfgdefault="${servercfgdir}/Game.ini" -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 From 02e2eadbab27f86ffefd5e4c91a0a65da0faf7b1 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Sat, 20 Aug 2016 08:44:59 -0400 Subject: [PATCH 13/13] removing unused variable --- UnrealTournament/utserver | 1 - 1 file changed, 1 deletion(-) diff --git a/UnrealTournament/utserver b/UnrealTournament/utserver index 8f1bb6498..ac27d2474 100644 --- a/UnrealTournament/utserver +++ b/UnrealTournament/utserver @@ -66,7 +66,6 @@ executable="./UE4Server-Linux-Shipping" servercfg="Game.ini" servercfgdir="${systemdir}/UnrealTournament/Saved/Config/LinuxServer" servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/Game.ini" backupdir="${rootdir}/backups" # Logging