From 871fd8c0f0615277f348cb1329a4445600822645 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Mon, 22 Aug 2016 09:33:57 -0400 Subject: [PATCH 01/15] adding Battlefield: 1942 --- Battlefield1942/bf1942server | 143 +++++++++++++++++++++++++ lgsm/functions/command_install.sh | 2 +- lgsm/functions/install_server_files.sh | 2 + 3 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 Battlefield1942/bf1942server diff --git a/Battlefield1942/bf1942server b/Battlefield1942/bf1942server new file mode 100644 index 000000000..47e7f863b --- /dev/null +++ b/Battlefield1942/bf1942server @@ -0,0 +1,143 @@ +#!/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 +timelimit="10" +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="hurdad" +githubrepo="linuxgsm" +githubbranch="master" + +# Server Details +servicename="bf1942-server" +gamename="Battlefield: 1942" +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}" +executable="./start.sh" +servercfg="serversettings.con" +servercfgdir="${systemdir}/mods/bf1942/settings" +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/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index 5184d2871..dc2afd232 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}" == "Enemy Territory" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]; then +elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Enemy Territory" ]||[ "${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_server_files.sh b/lgsm/functions/install_server_files.sh index dc9713586..95d7e1087 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}" == "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 From 630e3e400de4bc15ea52348506781e06ec8d8a58 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Mon, 22 Aug 2016 09:51:39 -0400 Subject: [PATCH 02/15] update --- Battlefield1942/bf1942server | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Battlefield1942/bf1942server b/Battlefield1942/bf1942server index 47e7f863b..d42012000 100644 --- a/Battlefield1942/bf1942server +++ b/Battlefield1942/bf1942server @@ -45,7 +45,7 @@ githubbranch="master" # Server Details servicename="bf1942-server" gamename="Battlefield: 1942" -engine="unreal4" +engine="refractor" # Directories rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" @@ -61,7 +61,6 @@ executable="./start.sh" servercfg="serversettings.con" servercfgdir="${systemdir}/mods/bf1942/settings" servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/lgsm-default.cfg" backupdir="${rootdir}/backups" # Logging From b5f91e9d03533f34d3825e1aa3ae506029add018 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Mon, 22 Aug 2016 09:57:25 -0400 Subject: [PATCH 03/15] adding glibc info --- lgsm/functions/info_glibc.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh index 6ec3a6a96..8df17c3ab 100644 --- a/lgsm/functions/info_glibc.sh +++ b/lgsm/functions/info_glibc.sh @@ -83,6 +83,9 @@ elif [ "${gamename}" == "Mumble" ]; then elif [ "${engine}" == "idtech3" ]; then glibcrequired="2.0" glibcfix="no" +elif [ "${engine}" == "refactor" ]; then + glibcrequired="2.0" + glibcfix="no" else glibcrequired="UNKNOWN" glibcfix="no" From 1904e077539e1d9a2563cc190dddeec4a77f8bb9 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Mon, 22 Aug 2016 09:57:43 -0400 Subject: [PATCH 04/15] fix --- Battlefield1942/bf1942server | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Battlefield1942/bf1942server b/Battlefield1942/bf1942server index d42012000..ba3f93587 100644 --- a/Battlefield1942/bf1942server +++ b/Battlefield1942/bf1942server @@ -26,7 +26,6 @@ pushbulletalert="off" pushbullettoken="accesstoken" # Start Variables -timelimit="10" ip="0.0.0.0" fn_parms(){ @@ -38,7 +37,7 @@ parms=" +hostServer 1 +dedicated 1" # Github Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="hurdad" +githubuser="dgibbs64" githubrepo="linuxgsm" githubbranch="master" From 71152c4b54de984f101dd8a76aba85e29cbff122 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Mon, 22 Aug 2016 10:01:15 -0400 Subject: [PATCH 05/15] typo --- lgsm/functions/info_glibc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh index 8df17c3ab..0b3af086e 100644 --- a/lgsm/functions/info_glibc.sh +++ b/lgsm/functions/info_glibc.sh @@ -83,7 +83,7 @@ elif [ "${gamename}" == "Mumble" ]; then elif [ "${engine}" == "idtech3" ]; then glibcrequired="2.0" glibcfix="no" -elif [ "${engine}" == "refactor" ]; then +elif [ "${engine}" == "refractor" ]; then glibcrequired="2.0" glibcfix="no" else From f910eea8215193f1d17fa1bd25b21af8cf428c17 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Mon, 22 Aug 2016 10:06:07 -0400 Subject: [PATCH 06/15] adding dep --- lgsm/functions/check_deps.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index e81d34c43..ef05af329 100644 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -176,6 +176,9 @@ 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 ) + # Battlefield: 1942 requies ncurses + elif [ "${gamename}" == "Battlefield: 1942" ]; then + array_deps_required+=( libncurses5:i386 ) # Project Zomboid elif [ "${engine}" == "projectzomboid" ]; then array_deps_required+=( default-jdk ) From 702d20677a7b7fdd014c2e9328f893efa3b4014b Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Tue, 23 Aug 2016 23:09:55 -0400 Subject: [PATCH 07/15] adding UT 3 installer --- lgsm/functions/command_install.sh | 2 +- lgsm/functions/install_server_files.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index dc2afd232..698aec70b 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}" == "Battlefield: 1942" ]||[ "${gamename}" == "Enemy Territory" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament" ]||[ "${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}" == "Mumble" ]; then installer=1 install_server_files.sh elif [ -n "${appid}" ]; then diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 95d7e1087..c86104af5 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 3" ]; then + fileurl="https://s3.amazonaws.com/unrealtournament/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 From 83d6b9ef2dbba77c32b7bbe29307450838ca23a6 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Tue, 23 Aug 2016 23:44:04 -0400 Subject: [PATCH 08/15] fix url --- lgsm/functions/install_server_files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index c86104af5..dfe07777d 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -14,7 +14,7 @@ fn_install_server_files(){ 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/unrealtournament/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" + 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 From 1ac908c0fc316a87ee16d2f84e063ceea6ecfabc Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Wed, 24 Aug 2016 01:08:54 -0400 Subject: [PATCH 09/15] update glib --- lgsm/functions/info_glibc.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lgsm/functions/info_glibc.sh b/lgsm/functions/info_glibc.sh index 0b3af086e..e5a55be0f 100644 --- a/lgsm/functions/info_glibc.sh +++ b/lgsm/functions/info_glibc.sh @@ -68,6 +68,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" From 295a233242c667ee62cca22c0c3e50e9b52d9c00 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Wed, 24 Aug 2016 01:10:52 -0400 Subject: [PATCH 10/15] adding Unreal Tournament 3 --- UnrealTournament3/ut3server | 157 ++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 UnrealTournament3/ut3server diff --git a/UnrealTournament3/ut3server b/UnrealTournament3/ut3server new file mode 100644 index 000000000..b7e77a4e1 --- /dev/null +++ b/UnrealTournament3/ut3server @@ -0,0 +1,157 @@ +#!/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="" +isdedicated="true" +islanmatch="true" +usesstats="false" +shouldadvertise="true" +pureserver="1" +allowjoininprogress="true" +maxplayers="32" +adminpw="changeme" + +#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}?AdminPassword=${adminpw}?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}" +servercfgdefault="${servercfgdir}/UTGame.ini" +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 + From a07926b929b8e96a0bfcf254dc31b77d075dbb23 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Wed, 24 Aug 2016 01:37:16 -0400 Subject: [PATCH 11/15] update --- UnrealTournament3/ut3server | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnrealTournament3/ut3server b/UnrealTournament3/ut3server index b7e77a4e1..44975f318 100644 --- a/UnrealTournament3/ut3server +++ b/UnrealTournament3/ut3server @@ -31,9 +31,9 @@ port="7777" queryport="25300" defaultmap="VCTF-Suspense" game="UTGameContent.UTVehicleCTFGame_Content" -mutators="" +mutators="" #"UTGame.UTMutator_Instagib,UTGame.UTMutator_LowGrav" isdedicated="true" -islanmatch="true" +islanmatch="false" usesstats="false" shouldadvertise="true" pureserver="1" From 302aa581945d7b25673c95d86a853f5f6ef35a70 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Wed, 24 Aug 2016 02:02:10 -0400 Subject: [PATCH 12/15] adding UT3 config --- UnrealTournament3/ut3server | 1 - lgsm/functions/install_config.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/UnrealTournament3/ut3server b/UnrealTournament3/ut3server index 44975f318..6b342995f 100644 --- a/UnrealTournament3/ut3server +++ b/UnrealTournament3/ut3server @@ -65,7 +65,6 @@ executable="./ut3" servercfg="UTGame.ini" servercfgdir="${systemdir}/UTGame/Config" servercfgfullpath="${servercfgdir}/${servercfg}" -servercfgdefault="${servercfgdir}/UTGame.ini" backupdir="${rootdir}/backups" # Logging diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index e23cac0a9..74b270932 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -165,6 +165,33 @@ 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}/UT-Game.ini" + echo "setting WebAdmin password." + fn_script_log_info "setting WebAdmin password." + sed -i 's/AdminPassword=/AdminPassword=admin/g' "${servercfgdir}/UT-Game.ini" + sleep 1 + echo "enabling WebAdmin." + fn_script_log_info "enabling WebAdmin." + sed -i 's/bEnabled=false/bEnabled=True/g' "${servercfgdir}/UT-Web.ini" + if [ "${gamename}" == "Unreal Tournament 3" ]; then + sleep 1 + echo "setting WebAdmin port to 8075." + fn_script_log_info "setting WebAdmin port to 8081." + sed -i 's/ListenPort=80/ListenPort=8081/g' "${servercfgdir}/UT-Web.ini" + fi + sleep 1 + echo "" + +} + fn_unrealtournament(){ # allow user to input server name and password if [ -z "${autoinstall}" ]; then @@ -420,6 +447,8 @@ elif [ "${gamename}" == "Unreal Tournament" ]; then 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 From 10eefb287647425ffe8f96b586b732b52c1d3a8b Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Wed, 24 Aug 2016 02:15:38 -0400 Subject: [PATCH 13/15] filename fix --- lgsm/functions/install_config.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 74b270932..5c8c877a7 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -173,19 +173,19 @@ fn_ut3config(){ 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}/UT-Game.ini" + sed -i 's/ServerName=/ServerName=LinuxGSM UT3 Server/g' "${servercfgdir}/DefaultGame.ini" echo "setting WebAdmin password." fn_script_log_info "setting WebAdmin password." - sed -i 's/AdminPassword=/AdminPassword=admin/g' "${servercfgdir}/UT-Game.ini" + sed -i 's/AdminPassword=/AdminPassword=admin/g' "${servercfgdir}/DefaultGame.ini" sleep 1 echo "enabling WebAdmin." fn_script_log_info "enabling WebAdmin." - sed -i 's/bEnabled=false/bEnabled=True/g' "${servercfgdir}/UT-Web.ini" + sed -i 's/bEnabled=false/bEnabled=True/g' "${servercfgdir}/DefaultWeb.ini" if [ "${gamename}" == "Unreal Tournament 3" ]; then sleep 1 echo "setting WebAdmin port to 8075." fn_script_log_info "setting WebAdmin port to 8081." - sed -i 's/ListenPort=80/ListenPort=8081/g' "${servercfgdir}/UT-Web.ini" + sed -i 's/ListenPort=80/ListenPort=8081/g' "${servercfgdir}/DefaultWeb.ini" fi sleep 1 echo "" From a7814afa999d43085ee421e8b6e0888a97b77b81 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Wed, 24 Aug 2016 02:42:52 -0400 Subject: [PATCH 14/15] fix --- lgsm/functions/install_config.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 5c8c877a7..228f35a7d 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -176,20 +176,20 @@ fn_ut3config(){ sed -i 's/ServerName=/ServerName=LinuxGSM UT3 Server/g' "${servercfgdir}/DefaultGame.ini" echo "setting WebAdmin password." fn_script_log_info "setting WebAdmin password." - sed -i 's/AdminPassword=/AdminPassword=admin/g' "${servercfgdir}/DefaultGame.ini" + 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 8075." + 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(){ From bed8509ad6f7587da2f30df0b12baec629d7ff05 Mon Sep 17 00:00:00 2001 From: Alexander Hurd Date: Wed, 24 Aug 2016 03:38:19 -0400 Subject: [PATCH 15/15] update --- UnrealTournament3/ut3server | 3 +-- lgsm/functions/install_config.sh | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/UnrealTournament3/ut3server b/UnrealTournament3/ut3server index 6b342995f..97f768974 100644 --- a/UnrealTournament3/ut3server +++ b/UnrealTournament3/ut3server @@ -39,11 +39,10 @@ shouldadvertise="true" pureserver="1" allowjoininprogress="true" maxplayers="32" -adminpw="changeme" #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}?AdminPassword=${adminpw}?Mutator=${mutators} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" +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 diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 228f35a7d..26bef215c 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -170,12 +170,12 @@ fn_ut3config(){ echo "Configuring ${gamename} Server" echo "=================================" sleep 1 - echo "setting ServerName to 'LinuxGSM UT3 Server'" - fn_script_log_info "setting ServerName to 'LinuxGSM UT3 Server'" + 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." - fn_script_log_info "setting WebAdmin password." + 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