diff --git a/.travis.yml b/.travis.yml index 4e39e2473..7a1c63dcf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,4 +22,5 @@ addons: script: - - bash tests/test.sh \ No newline at end of file + - bash tests/tests_jc2server.sh + - bash tests/tests_ts3server.sh \ No newline at end of file diff --git a/7DaysToDie/sdtdserver b/7DaysToDie/sdtdserver index 155a1f206..828ef2509 100644 --- a/7DaysToDie/sdtdserver +++ b/7DaysToDie/sdtdserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -27,6 +27,13 @@ parms="-configfile=${servercfgfullpath} -dedicated" #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="294420" @@ -36,8 +43,8 @@ gamename="7 Days To Die" engine="unity3d" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -66,20 +73,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ @@ -92,3 +124,4 @@ fn_functions getopt=$1 fn_getopt + diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index 66df45d46..c25c34cd3 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -26,6 +26,13 @@ parms="TheIsland?listen" #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="376030" @@ -35,8 +42,8 @@ gamename="ARK: Survivial Evolved" engine="unreal4" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/ShooterGame" @@ -64,20 +71,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/Arma3/arma3server b/Arma3/arma3server index 437d05a88..a23465a5c 100644 --- a/Arma3/arma3server +++ b/Arma3/arma3server @@ -4,7 +4,7 @@ # Author: Daniel Gibbs # Contributor: Scarsz # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -35,6 +35,13 @@ mods="" #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam # Stable appid="233780" @@ -47,8 +54,8 @@ gamename="ARMA 3" engine="realvirtuality" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -79,20 +86,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/BlackMesa/bmdmserver b/BlackMesa/bmdmserver index 1db27c323..e03519482 100644 --- a/BlackMesa/bmdmserver +++ b/BlackMesa/bmdmserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="346680" @@ -41,8 +48,8 @@ gamename="Black Mesa: Deathmatch" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/bms" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/BladeSymphony/bsserver b/BladeSymphony/bsserver index 4f3157a9a..7435e8951 100644 --- a/BladeSymphony/bsserver +++ b/BladeSymphony/bsserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="-autoupdate -strictportbind -ip ${ip} -port ${port} +clientport ${clientp #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="228780" @@ -41,8 +48,8 @@ gamename="Blade Symphony" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/berimbau" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/ChivalryMedievalWarfare/cmwserver b/ChivalryMedievalWarfare/cmwserver index 6837ca07b..2ca77e087 100644 --- a/ChivalryMedievalWarfare/cmwserver +++ b/ChivalryMedievalWarfare/cmwserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="${defaultmap}\?steamsockets\?adminpassword=${adminpassword}\?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" + # Steam appid="220070" @@ -41,8 +48,8 @@ gamename="Chivalry: Medieval Warfare" engine="unreal3" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/CounterStrike/csserver b/CounterStrike/csserver index 367aec289..ae9d3db75 100644 --- a/CounterStrike/csserver +++ b/CounterStrike/csserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -26,11 +26,18 @@ updateonstart="off" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 fn_parms(){ -parms="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" +parms="-game cstrike -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" } #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="90" appidmod="cstrike" @@ -41,8 +48,8 @@ gamename="Counter Strike 1.6" engine="goldsource" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/cstrike" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver index b27ea812f..d69529a84 100644 --- a/CounterStrikeConditionZero/csczserver +++ b/CounterStrikeConditionZero/csczserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -26,11 +26,18 @@ updateonstart="off" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 fn_parms(){ -parms="-game czero -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" +parms="-game czero -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" } #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="90" appidmod="czero" @@ -41,8 +48,8 @@ gamename="Counter Strike: Condition Zero" engine="goldsource" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/czero" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/CounterStrikeGlobalOffensive/csgoserver b/CounterStrikeGlobalOffensive/csgoserver index 4239ce98a..32802fdb2 100755 --- a/CounterStrikeGlobalOffensive/csgoserver +++ b/CounterStrikeGlobalOffensive/csgoserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -35,6 +35,12 @@ sourcetvport="27020" clientport="27005" ip="0.0.0.0" updateonstart="off" + +# Required: Game Server Login Token +# GSLT is required for running a public server. +# More info: http://gameservermanagers.com/gslt +gslt="" + # Optional: Workshop Parameters # https://developer.valvesoftware.com/wiki/CSGO_Workshop_For_Server_Operators # To get an authkey visit - http://steamcommunity.com/dev/apikey @@ -44,11 +50,18 @@ updateonstart="off" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server fn_parms(){ -parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_mode ${gamemode} +game_type ${gametype} +host_workshop_collection ${ws_collection_id} +workshop_start_map ${ws_start_map} -authkey ${authkey}" +parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_mode ${gamemode} +game_type ${gametype} +host_workshop_collection ${ws_collection_id} +workshop_start_map ${ws_start_map} -authkey ${authkey}" } #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="740" @@ -58,8 +71,8 @@ gamename="Counter Strike: Global Offensive" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/csgo" @@ -87,20 +100,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" + fi + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" fi -source "${rootdir}/functions/${functionfile}" +if [ "${exec}" ]; then + source "${filepath}" +fi +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/CounterStrikeSource/cssserver b/CounterStrikeSource/cssserver index 3356db60d..3727811de 100644 --- a/CounterStrikeSource/cssserver +++ b/CounterStrikeSource/cssserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="-game cstrike -strictportbind -ip ${ip} -port ${port} +clientport ${clien #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="232330" @@ -41,8 +48,8 @@ gamename="Counter Strike: Source" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/cstrike" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver index b9d731913..f57f85114 100644 --- a/DayOfDefeat/dodserver +++ b/DayOfDefeat/dodserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -26,11 +26,18 @@ updateonstart="off" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 fn_parms(){ -parms="-game dod -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" +parms="-game dod -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" } #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="90" appidmod="dod" @@ -41,8 +48,8 @@ gamename="Day of Defeat" engine="goldsource" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dod" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/DayOfDefeatSource/dodsserver b/DayOfDefeatSource/dodsserver index 50812a917..71a4c2bd5 100644 --- a/DayOfDefeatSource/dodsserver +++ b/DayOfDefeatSource/dodsserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="-game dod -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="232290" @@ -41,8 +48,8 @@ gamename="Day of Defeat: Source" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dod" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/DeathmatchClassic/dmcserver b/DeathmatchClassic/dmcserver index d567e7d4a..17aaf53c3 100644 --- a/DeathmatchClassic/dmcserver +++ b/DeathmatchClassic/dmcserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -26,11 +26,18 @@ updateonstart="off" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 fn_parms(){ -parms="-game dmc -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" +parms="-game dmc -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" } #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="90" appidmod="dmc" @@ -41,8 +48,8 @@ gamename="Deathmatch Classic" engine="goldsource" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dmc" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/DontStarveTogether/dstserver b/DontStarveTogether/dstserver index c7cde8b49..9bfac516a 100644 --- a/DontStarveTogether/dstserver +++ b/DontStarveTogether/dstserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="070715" +version="121215" #### Variables #### @@ -26,6 +26,13 @@ parms="" #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="343050" @@ -35,8 +42,8 @@ gamename="Dont Starve Together" engine="dontstarve" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -64,20 +71,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/DoubleActionBoogaloo/dabserver b/DoubleActionBoogaloo/dabserver index f5643b06b..6207e2df7 100644 --- a/DoubleActionBoogaloo/dabserver +++ b/DoubleActionBoogaloo/dabserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="-strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_por #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="317800" @@ -41,8 +48,8 @@ gamename="Double Action: Boogaloo" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dab" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/FistfulOfFrags/fofserver b/FistfulOfFrags/fofserver index aa7c075f6..87742eb90 100644 --- a/FistfulOfFrags/fofserver +++ b/FistfulOfFrags/fofserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="-game fof -strictportbind -ip ${ip} -port ${port} +clientport ${clientpor #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="295230" @@ -41,8 +48,8 @@ gamename="Fistful of Frags" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/fof" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/GarrysMod/gmodserver b/GarrysMod/gmodserver index 344793856..97d812708 100644 --- a/GarrysMod/gmodserver +++ b/GarrysMod/gmodserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -38,6 +38,13 @@ parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} +host_workshop_co #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="4020" @@ -47,8 +54,8 @@ gamename="Garry's Mod" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/garrysmod" @@ -76,20 +83,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/HalfLife2Deathmatch/hl2dmserver b/HalfLife2Deathmatch/hl2dmserver index e8dc94ef5..aacb0aa56 100644 --- a/HalfLife2Deathmatch/hl2dmserver +++ b/HalfLife2Deathmatch/hl2dmserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="-game hl2mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientp #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="232370" @@ -41,8 +48,8 @@ gamename="Half Life 2: Deathmatch" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/hl2mp" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/HalfLifeDeathmatch/hldmserver b/HalfLifeDeathmatch/hldmserver index bda65eba8..12a082a45 100644 --- a/HalfLifeDeathmatch/hldmserver +++ b/HalfLifeDeathmatch/hldmserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -26,11 +26,18 @@ updateonstart="off" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 fn_parms(){ -parms="-game valve -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" +parms="-game valve -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" } #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="90" @@ -40,8 +47,8 @@ gamename="Half Life: Deathmatch" engine="goldsource" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/valve" @@ -69,21 +76,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" - sleep 1 + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/HalfLifeDeathmatchSource/hldmsserver b/HalfLifeDeathmatchSource/hldmsserver index 8688f3755..46e623507 100644 --- a/HalfLifeDeathmatchSource/hldmsserver +++ b/HalfLifeDeathmatchSource/hldmsserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="-game hl1mp -strictportbind -ip ${ip} -port ${port} +clientport ${clientp #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="255470" @@ -41,8 +48,8 @@ gamename="Half-Life Deathmatch: Source" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/hl1mp" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/Insurgency/insserver b/Insurgency/insserver index f5a69ebbb..290095b1e 100644 --- a/Insurgency/insserver +++ b/Insurgency/insserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="-game insurgency -strictportbind -ip ${ip} -port ${port} +clientport ${cl #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="237410" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/JustCause2/jc2server b/JustCause2/jc2server index 84fcce11f..7ae146618 100644 --- a/JustCause2/jc2server +++ b/JustCause2/jc2server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="150715" +version="121215" #### Variables #### @@ -25,6 +25,13 @@ parms="" #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="261140" @@ -34,8 +41,8 @@ gamename="Just Cause 2" engine="avalanche" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -63,20 +70,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/KillingFloor/kfserver b/KillingFloor/kfserver index 178c661b3..4a2a26ae6 100644 --- a/KillingFloor/kfserver +++ b/KillingFloor/kfserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -31,6 +31,13 @@ parms="server ${defaultmap}?game=KFmod.KFGameType?VACSecured=true -nohomedir ini #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="215360" @@ -40,8 +47,8 @@ gamename="Killing Floor" engine="unreal2" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/System" @@ -72,20 +79,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/Left4Dead/l4dserver b/Left4Dead/l4dserver index d75d0f868..edbb38e38 100644 --- a/Left4Dead/l4dserver +++ b/Left4Dead/l4dserver @@ -4,7 +4,7 @@ # Author: Daniel Gibbs # Contributor: Summit Singh Thakur # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="-game left4dead -strictportbind -ip ${ip} -port ${port} +clientport ${cli #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="222840" @@ -41,8 +48,8 @@ gamename="Left 4 Dead" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/left4dead" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server index 0a5043ef7..d404bff02 100644 --- a/Left4Dead2/l4d2server +++ b/Left4Dead2/l4d2server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -31,6 +31,13 @@ parms="-game left4dead2 -strictportbind -ip ${ip} -port ${port} +clientport ${cl #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="222860" @@ -40,8 +47,8 @@ gamename="Left 4 Dead 2" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/left4dead2" @@ -69,20 +76,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index 9223cbce0..5ad385d64 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -17,8 +17,8 @@ gamename="Mumble" servicename="mumble-server" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -46,23 +46,55 @@ fn_parms(){ 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" +githubbranch="master" + ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ @@ -75,3 +107,4 @@ fn_functions getopt=$1 fn_getopt + diff --git a/NS2Combat/ns2cserver b/NS2Combat/ns2cserver index 7e7f8ac11..71e8f56ae 100644 --- a/NS2Combat/ns2cserver +++ b/NS2Combat/ns2cserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -41,6 +41,13 @@ parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="313900" @@ -50,8 +57,8 @@ gamename="NS2: Combat" engine="spark" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -75,20 +82,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/NaturalSelection2/ns2server b/NaturalSelection2/ns2server index 04f5dcccf..670013bcb 100644 --- a/NaturalSelection2/ns2server +++ b/NaturalSelection2/ns2server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -41,6 +41,13 @@ parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="4940" @@ -50,8 +57,8 @@ gamename="Natural Selection 2" engine="spark" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -75,20 +82,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver index 0dc838c16..877dfc873 100644 --- a/NoMoreRoomInHell/nmrihserver +++ b/NoMoreRoomInHell/nmrihserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="-game nmrih -insecure -strictportbind -ip ${ip} -port ${port} +clientport #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="317670" @@ -41,8 +48,8 @@ gamename="No More Room in Hell" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/nmrih" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/OpposingForce/opforserver b/OpposingForce/opforserver index b0a77a0f8..96ddadc13 100644 --- a/OpposingForce/opforserver +++ b/OpposingForce/opforserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -26,11 +26,18 @@ updateonstart="off" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 fn_parms(){ -parms="-game gearbox -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" +parms="-game gearbox -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" } #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="90" appidmod="gearbox" @@ -41,8 +48,8 @@ gamename="Half-Life: Opposing Force" engine="goldsource" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/gearbox" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/PiratesVikingandKnightsII/pvkiiserver b/PiratesVikingandKnightsII/pvkiiserver index baa625b47..c99f67360 100644 --- a/PiratesVikingandKnightsII/pvkiiserver +++ b/PiratesVikingandKnightsII/pvkiiserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="051115" +version="121215" #### Variables #### @@ -32,6 +32,13 @@ parms="-game pvkii -strictportbind -ip ${ip} -port ${port} +clientport ${clientp #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="17575" @@ -41,8 +48,8 @@ gamename="Pirates, Vikings, and Knights II" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/pvkii" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver index 15870a6fc..edcb1f247 100644 --- a/ProjectZomboid/pzserver +++ b/ProjectZomboid/pzserver @@ -4,7 +4,7 @@ # Author: Daniel Gibbs # Contributions: Bryce Van Dyk (SingingTree) # Website: http://gameservermanagers.com -version="031015" +version="121215" #### Variables #### @@ -14,7 +14,7 @@ emailnotification="off" email="email@example.com" # Steam login -steamuser="username" +steamuser="anonymous" steampass="password" # Start Variables @@ -27,6 +27,13 @@ parms="" #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="380870" @@ -36,8 +43,8 @@ gamename="Project Zomboid" engine="projectzomboid" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -64,20 +71,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/RedOrchestra/roserver b/RedOrchestra/roserver index a94241904..3395e1203 100644 --- a/RedOrchestra/roserver +++ b/RedOrchestra/roserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -27,6 +27,13 @@ parms="server ${defaultmap}?game=ROGame.ROTeamGame?VACSecured=true -nohomedir in #### 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="ro-server" gamename="Red Orchestra: Ostfront 41-45" @@ -36,8 +43,8 @@ engine="unreal2" appid="223250" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/system" @@ -68,20 +75,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/Ricochet/ricochetserver b/Ricochet/ricochetserver index 03357b365..d10bd44a6 100644 --- a/Ricochet/ricochetserver +++ b/Ricochet/ricochetserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -26,11 +26,18 @@ updateonstart="off" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 fn_parms(){ -parms="-game ricochet -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" +parms="-game ricochet -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" } #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="90" appidmod="ricochet" @@ -41,8 +48,8 @@ gamename="Ricochet" engine="goldsource" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/ricochet" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/SeriousSam3BFE/ss3sserver b/SeriousSam3BFE/ss3sserver index 87e7c2582..fb8827daa 100644 --- a/SeriousSam3BFE/ss3sserver +++ b/SeriousSam3BFE/ss3sserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -27,6 +27,13 @@ parms="+ip ${ip} +logfile ${gamelog} +exec ${servercfgfullpath}" #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="41080" @@ -36,8 +43,8 @@ gamename="Serious Sam 3: BFE" engine="seriousengine35" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/Bin" @@ -67,20 +74,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/StarBound/sbserver b/StarBound/sbserver index ed6723ad1..fa42b5b4f 100644 --- a/StarBound/sbserver +++ b/StarBound/sbserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -26,6 +26,13 @@ parms="" #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="211820" @@ -35,8 +42,8 @@ gamename="Starbound" engine="starbound" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -63,20 +70,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/TeamFortress2/tf2server b/TeamFortress2/tf2server index b40840dd1..864e55b32 100644 --- a/TeamFortress2/tf2server +++ b/TeamFortress2/tf2server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -25,13 +25,25 @@ clientport="27005" ip="0.0.0.0" updateonstart="off" +# Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: http://gameservermanagers.com/gslt +gslt="" + # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server fn_parms(){ -parms="-game tf -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +parms="-game tf -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" } #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="232250" @@ -41,8 +53,8 @@ gamename="Team Fortress 2" engine="source" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/tf" @@ -70,20 +82,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" + fi + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" fi -source "${rootdir}/functions/${functionfile}" +if [ "${exec}" ]; then + source "${filepath}" +fi +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/TeamFortressClassic/tfcserver b/TeamFortressClassic/tfcserver index c8655191b..e9222454a 100644 --- a/TeamFortressClassic/tfcserver +++ b/TeamFortressClassic/tfcserver @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="291015" +version="121215" #### Variables #### @@ -26,11 +26,18 @@ updateonstart="off" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Command-line_parameters_2 fn_parms(){ -parms="-game tfc -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" +parms="-game tfc -strictportbind _ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}" } #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="90" appidmos="tfc" @@ -41,8 +48,8 @@ gamename="Team Fortress Classic" engine="goldsource" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/tfc" @@ -70,20 +77,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/TeamSpeak3/ts3server b/TeamSpeak3/ts3server index cac5687f0..d9b9e33c1 100644 --- a/TeamSpeak3/ts3server +++ b/TeamSpeak3/ts3server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -21,8 +21,8 @@ servername="Teamspeak 3 Server" servicename="ts3-server" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -43,23 +43,55 @@ emaillog="${scriptlogdir}/${servicename}-email.log" scriptlogdate="${scriptlogdir}/${servicename}-script-$(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="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/Teeworlds/twserver b/Teeworlds/twserver index 0cea9644d..4779119fd 100644 --- a/Teeworlds/twserver +++ b/Teeworlds/twserver @@ -4,7 +4,7 @@ # Author: Daniel Gibbs # Contributor: Bryce Van Dyk (SingingTree) # Website: http://gameservermanagers.com -version="281015" +version="121215" #### Variables #### @@ -27,6 +27,13 @@ parms="-f ${servercfgfullpath}" #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="380840" @@ -36,8 +43,8 @@ gamename="Teeworlds" engine="teeworlds" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -66,20 +73,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/Terraria/terrariaserver b/Terraria/terrariaserver index a32af02d7..83d42fda9 100644 --- a/Terraria/terrariaserver +++ b/Terraria/terrariaserver @@ -4,7 +4,7 @@ # Author: Daniel Gibbs # Contributor: Bryce Van Dyk (SingingTree) # Website: http://gameservermanagers.com -version="070915" +version="121215" #### Variables #### @@ -27,6 +27,13 @@ parms="-config ${servercfgfullpath}" #### Advanced Variables #### +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + # Steam appid="105600" @@ -36,8 +43,8 @@ gamename="Terraria" engine="terraria" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -65,20 +72,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/UnrealTournament2004/ut2k4server b/UnrealTournament2004/ut2k4server index d7e780520..eba2804f6 100644 --- a/UnrealTournament2004/ut2k4server +++ b/UnrealTournament2004/ut2k4server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -26,8 +26,8 @@ gamename="Unreal Tournament 2004" engine="unreal2" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/System" @@ -55,23 +55,55 @@ 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="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/UnrealTournament99/ut99server b/UnrealTournament99/ut99server index 43f51859a..609a2d160 100644 --- a/UnrealTournament99/ut99server +++ b/UnrealTournament99/ut99server @@ -3,7 +3,7 @@ # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="040715" +version="121215" #### Variables #### @@ -28,8 +28,8 @@ gamename="Unreal Tournament 99" engine="unreal" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/System" @@ -54,23 +54,55 @@ 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" +# Github Branch Select +# Allows for the use of different function files +# from a different repo and/or branch. +githubuser="dgibbs64" +githubrepo="linuxgsm" +githubbranch="master" + ##### Script ##### # Do not edit -fn_runfunction(){ -# Functions are downloaded and run with this function -if [ ! -f "${rootdir}/functions/${functionfile}" ]; then - cd "${rootdir}" - if [ ! -d "functions" ]; then - mkdir functions +fn_getgithubfile(){ +filename=$1 +exec=$2 +fileurl=${3:-$filename} +filepath="${rootdir}/${filename}" +filedir=$(dirname "${filepath}") +# If the function file is missing, then download +if [ ! -f "${filepath}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir "${filedir}" fi - cd functions - echo -e " loading ${functionfile}...\c" - wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- - chmod +x "${functionfile}" - cd "${rootdir}" + githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" + echo -e " fetching ${filename}...\c" + if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit + fi + CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo " $CURL"|grep "curl:" + echo -e "${githuburl}\n" + exit + else + echo -e "\e[0;32mOK\e[0m" + fi + if [ "${exec}" ]; then + chmod +x "${filepath}" + fi +fi +if [ "${exec}" ]; then + source "${filepath}" fi -source "${rootdir}/functions/${functionfile}" +} + +fn_runfunction(){ + fn_getgithubfile "functions/${functionfile}" 1 } fn_functions(){ diff --git a/functions/fn_backup b/functions/fn_backup index 3d3f5a7a9..dd3122d17 100644 --- a/functions/fn_backup +++ b/functions/fn_backup @@ -2,7 +2,7 @@ # LGSM fn_backup function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +lgsm_version="061115" # Description: Creates a .tar.gz file in the backup directory. @@ -58,4 +58,4 @@ sleep 1 echo "" fn_printcompletenl "Complete." fn_scriptlog "Complete" -echo "" \ No newline at end of file +echo "" diff --git a/functions/fn_check_ip b/functions/fn_check_ip index 06ce0adc1..e5b81268d 100644 --- a/functions/fn_check_ip +++ b/functions/fn_check_ip @@ -2,7 +2,7 @@ # LGSM fn_check_ip function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +lgsm_version="061115" # Description: Automatically identifies the server interface IP. # If multiple interfaces are detected the user will need to manualy set using ip="0.0.0.0". diff --git a/functions/fn_check_logs b/functions/fn_check_logs index 50ebfe824..526a4036b 100644 --- a/functions/fn_check_logs +++ b/functions/fn_check_logs @@ -2,7 +2,8 @@ # LGSM fn_check_logs function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 190515 +lgsm_version="061115" + # Description: Checks that log files exist on server start # Create dir's for the script and console logs @@ -13,4 +14,4 @@ if [ ! -d "${scriptlogdir}" ]; then echo -en "\n" checklogs=1 fn_install_logs -fi \ No newline at end of file +fi diff --git a/functions/fn_check_root b/functions/fn_check_root index 64ee2cca2..16f253e35 100644 --- a/functions/fn_check_root +++ b/functions/fn_check_root @@ -2,9 +2,9 @@ # LGSM fn_check_root function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +lgsm_version="061115" if [ $(whoami) = "root" ]; then fn_printfailnl "Do NOT run this script as root!" exit 1 -fi \ No newline at end of file +fi diff --git a/functions/fn_check_steamcmd b/functions/fn_check_steamcmd index fb5f19841..4ec0bb948 100644 --- a/functions/fn_check_steamcmd +++ b/functions/fn_check_steamcmd @@ -2,7 +2,7 @@ # LGSM fn_check_steamcmd function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 210115 +lgsm_version="061115" # Description: Downloads SteamCMD on install and checks if missing before running functions that require SteamCMD diff --git a/functions/fn_check_steamuser b/functions/fn_check_steamuser index 264d7cb49..8861260eb 100644 --- a/functions/fn_check_steamuser +++ b/functions/fn_check_steamuser @@ -2,7 +2,7 @@ # LGSM fn_check_steamuser function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 040715 +lgsm_version="061115" if [ "${steamuser}" == "username" ]; then fn_printfailnl "Steam login not set. Update steamuser." diff --git a/functions/fn_check_systemdir b/functions/fn_check_systemdir index 47a3f4860..fba1566f0 100644 --- a/functions/fn_check_systemdir +++ b/functions/fn_check_systemdir @@ -2,9 +2,9 @@ # LGSM fn_check_systemdir function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +lgsm_version="061115" if [ ! -e "${systemdir}" ]; then fn_printfailnl "Cannot access ${systemdir}: No such directory" exit 1 -fi \ No newline at end of file +fi diff --git a/functions/fn_check_tmux b/functions/fn_check_tmux index 49ab4f18d..13aedad4f 100644 --- a/functions/fn_check_tmux +++ b/functions/fn_check_tmux @@ -2,7 +2,7 @@ # LGSM fn_check_tmux function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +lgsm_version="061115" # Checks if tmux is installed as too many users do not RTFM or know how to use Google. @@ -17,4 +17,4 @@ else echo " * Please see the the following link." echo " * http://gameservermanagers.com/tmux-not-found" exit 127 -fi \ No newline at end of file +fi diff --git a/functions/fn_check_ts3status b/functions/fn_check_ts3status index 40853019a..6cabddb3b 100644 --- a/functions/fn_check_ts3status +++ b/functions/fn_check_ts3status @@ -2,9 +2,9 @@ # LGSM fn_check_ts3status function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 070215 +lgsm_version="061115" # Checks the status of Teamspeak 3. cd "${executabledir}" -ts3status=$(./ts3server_startscript.sh status servercfgfullpathfile=${servercfgfullpath}) \ No newline at end of file +ts3status=$(./ts3server_startscript.sh status servercfgfullpathfile=${servercfgfullpath}) diff --git a/functions/fn_compress_unreal2maps b/functions/fn_compress_unreal2maps index 00b35ae09..fec5d113f 100644 --- a/functions/fn_compress_unreal2maps +++ b/functions/fn_compress_unreal2maps @@ -2,7 +2,7 @@ # LGSM fn_compress_unreal2maps function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +lgsm_version="061115" fn_check_root clear diff --git a/functions/fn_compress_ut99maps b/functions/fn_compress_ut99maps index 2f608c0a3..f9e0c9433 100644 --- a/functions/fn_compress_ut99maps +++ b/functions/fn_compress_ut99maps @@ -2,7 +2,7 @@ # LGSM fn_compress_ut99maps function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +lgsm_version="061115" fn_check_root clear diff --git a/functions/fn_console b/functions/fn_console index 38e055f3f..992c9bd1a 100644 --- a/functions/fn_console +++ b/functions/fn_console @@ -2,7 +2,7 @@ # LGSM fn_console function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +lgsm_version="061115" # Description: Gives access to the server tmux console. diff --git a/functions/fn_csgofix b/functions/fn_csgofix index abe9f9744..1af77b87a 100644 --- a/functions/fn_csgofix +++ b/functions/fn_csgofix @@ -2,7 +2,7 @@ # LGSM fn_csgofix function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 210115 +lgsm_version="061115" # Description: Resolves various issues with csgo. @@ -22,31 +22,39 @@ fi fn_csgofixes(){ # Fixes the following error: # Error parsing BotProfile.db - unknown attribute 'Rank". -if ! grep -q "//Rank" "${systemdir}/botprofile.db" ; then +if ! grep -q "//Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then + echo "Applying botprofile.db fix." + sleep 1 + echo "" echo "botprofile.db fix removes the following error from appearing on the console:" echo " Error parsing BotProfile.db - unknown attribute 'Rank" sleep 1 - fn_printdots "Applying botprofile.db fix." - sleep 1 - fn_printinfo "Applying botprofile.db fix." - sleep 1 - sed -i 's/\tRank/\t\/\/Rank/g' "${systemdir}/botprofile.db" + sed -i 's/\tRank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1 + if [[ $? != 0 ]]; then + fn_printfailure "Applying botprofile.db fix." + else + fn_printcomplete "Applying botprofile.db fix." + fi echo -en "\n" echo "" fi # Fixes errors simular to the following: # Unknown command "cl_bobamt_vert". -if ! grep -q "//exec default" "${servercfgdir}/valve.rc" || ! grep -q "//exec joystick" "${servercfgdir}/valve.rc"; then +if ! grep -q "//exec default" "${servercfgdir}/valve.rc" > /dev/null 2>&1 || ! grep -q "//exec joystick" "${servercfgdir}/valve.rc" > /dev/null 2>&1; then + echo "Applying valve.rc fix." + sleep 1 + echo "" echo "valve.rc fix removes the following error from appearing on the console:" echo " Unknown command \"cl_bobamt_vert\"" sleep 1 - fn_printdots "Applying valve.rc fix." - sleep 1 - fn_printinfo "Applying valve.rc fix." - sleep 1 - sed -i 's/exec default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" - sed -i 's/exec joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" + sed -i 's/exec default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 + sed -i 's/exec joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 + if [[ $? != 0 ]]; then + fn_printfailure "Applying valve.rc fix." + else + fn_printcomplete "Applying valve.rc fix." + fi echo -en "\n" echo "" fi @@ -57,13 +65,17 @@ if [ -f "${systemdir}/subscribed_collection_ids.txt" ]||[ -f "${systemdir}/subsc echo "workshopmapfix fixes the following error:" echo " http://forums.steampowered.com/forums/showthread.php?t=3170366" sleep 1 - fn_printdots "Applying workshopmap fix." - sleep 1 - fn_printinfo "Applying workshopmap fix." + echo "" + echo "Applying workshopmap fix." sleep 1 rm -f "${systemdir}/subscribed_collection_ids.txt" rm -f "${systemdir}/subscribed_file_ids.txt" rm -f "${systemdir}/ugc_collection_cache.txt" + if [[ $? != 0 ]]; then + fn_printfailure "Applying workshopmap fix." + else + fn_printcomplete "Applying workshopmap fix." + fi echo -en "\n" echo "" fi diff --git a/functions/fn_debug b/functions/fn_debug index ce2f91ce9..b593f0415 100644 --- a/functions/fn_debug +++ b/functions/fn_debug @@ -2,7 +2,7 @@ # LGSM fn_debug function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 051115 +lgsm_version="061115" # Description: Runs the server without tmux. Runs direct from the terminal. diff --git a/functions/fn_deps_detect b/functions/fn_deps_detect index 9969603c0..1ff872136 100644 --- a/functions/fn_deps_detect +++ b/functions/fn_deps_detect @@ -2,7 +2,7 @@ # LGSM fn_dep_detect function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 290615 +lgsm_version="061115" # Description: Detects dependencies the server binary requires. diff --git a/functions/fn_details b/functions/fn_details index 5110d54c2..84ac3c0d9 100644 --- a/functions/fn_details +++ b/functions/fn_details @@ -2,7 +2,7 @@ # LGSM fn_details function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 011115 +lgsm_version="061115" # Description: Displays server infomation. diff --git a/functions/fn_details_config b/functions/fn_details_config index 815153f23..d24751f81 100644 --- a/functions/fn_details_config +++ b/functions/fn_details_config @@ -2,7 +2,7 @@ # LGSM fn_details_config function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 301015 +lgsm_version="061115" # Description: Gets specific details from config files. diff --git a/functions/fn_details_distro b/functions/fn_details_distro index 4246d4a89..ff9856036 100644 --- a/functions/fn_details_distro +++ b/functions/fn_details_distro @@ -2,7 +2,7 @@ # LGSM fn_details_distro function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 301015 +lgsm_version="061115" # Description: Variables providing useful info on the Operating System such as disk and performace info. # Used for fn_details, fn_debug and fn_email. diff --git a/functions/fn_details_glibc b/functions/fn_details_glibc index 3902990fa..dc6efb427 100644 --- a/functions/fn_details_glibc +++ b/functions/fn_details_glibc @@ -2,7 +2,7 @@ # LGSM fn_details_glibc function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 180715 +lgsm_version="061115" # Description: stores details on servers Glibc requirements. diff --git a/functions/fn_email b/functions/fn_email index e5ea2ed04..e24c5eb75 100644 --- a/functions/fn_email +++ b/functions/fn_email @@ -2,7 +2,7 @@ # LGSM fn_email function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 290815 +lgsm_version="061115" # Description: Sends email notification if monitor picks up a failure. diff --git a/functions/fn_email_test b/functions/fn_email_test index 0d7c8c9af..f46924d53 100644 --- a/functions/fn_email_test +++ b/functions/fn_email_test @@ -2,7 +2,7 @@ # LGSM fn_email_test function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 210115 +lgsm_version="061115" # Description: Sends a test email notification. diff --git a/functions/fn_functions b/functions/fn_functions index 0d2699f91..101354460 100644 --- a/functions/fn_functions +++ b/functions/fn_functions @@ -2,7 +2,7 @@ # LGSM fn_functions function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 150715 +lgsm_version="061115" # Description: Defines all functions to allow download and execution of functions using fn_runfunction. # This function is called first before any other function. Without this file other functions would not load. @@ -219,6 +219,11 @@ functionfile="${FUNCNAME}" fn_runfunction } +fn_install_gslt(){ +functionfile="${FUNCNAME}" +fn_runfunction +} + fn_install_header(){ functionfile="${FUNCNAME}" fn_runfunction diff --git a/functions/fn_getopt b/functions/fn_getopt index 2927ca76e..f35afa848 100644 --- a/functions/fn_getopt +++ b/functions/fn_getopt @@ -2,7 +2,7 @@ # LGSM fn_getopt function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 091215 +lgsm_version="061115" # Description: getopt arguments. diff --git a/functions/fn_insfix b/functions/fn_insfix index 85d695f57..8a583078c 100644 --- a/functions/fn_insfix +++ b/functions/fn_insfix @@ -2,8 +2,17 @@ # LGSM fn_insfix function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 110415 +lgsm_version="110415" # Description: Resolves ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory -export LD_LIBRARY_PATH=:${filesdir}:${filesdir}/bin:{$LD_LIBRARY_PATH} \ No newline at end of file +export LD_LIBRARY_PATH=:${filesdir}:${filesdir}/bin:{$LD_LIBRARY_PATH} + +# fix for issue #529 - gamemode not passed to debug or start + +if [ "${getopt}" == "debug" ]; then + defaultmap="\"${defaultmap}\"" +else + defaultmap="\\\"${defaultmap}\\\"" +fi +fn_parms diff --git a/functions/fn_install b/functions/fn_install index 3f193015b..7c47a6b9b 100644 --- a/functions/fn_install +++ b/functions/fn_install @@ -2,7 +2,7 @@ # LGSM fn_install function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 190515 +lgsm_version="061115" fn_check_root fn_install_header @@ -32,7 +32,10 @@ fn_install_logs fn_install_gsquery fn_install_config if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then + fn_install_gslt fn_csgofix +elif [ "${gamename}" == "Team Fortress 2" ]; then + fn_install_gslt elif [ "${gamename}" == "Killing Floor" ]; then fn_install_kffix elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then diff --git a/functions/fn_install_complete b/functions/fn_install_complete index f5b87625d..a9690d5ac 100644 --- a/functions/fn_install_complete +++ b/functions/fn_install_complete @@ -2,7 +2,7 @@ # LGSM fn_install_complete function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 070715 +lgsm_version="061115" if [ "${gamename}" == "Dont Starve Together" ]; then echo "" diff --git a/functions/fn_install_config b/functions/fn_install_config index 3cc70d389..39e95516f 100644 --- a/functions/fn_install_config +++ b/functions/fn_install_config @@ -2,7 +2,7 @@ # LGSM fn_install_config function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 051115 +lgsm_version="061115" fn_defaultconfig(){ echo "creating ${servercfg} config file." diff --git a/functions/fn_install_glibcfix b/functions/fn_install_glibcfix index 11dc3362d..0db2c48eb 100644 --- a/functions/fn_install_glibcfix +++ b/functions/fn_install_glibcfix @@ -2,7 +2,7 @@ # LGSM fn_install_glibcfix function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 051115 +lgsm_version="061115" fn_glibcfixmsg(){ echo "" diff --git a/functions/fn_install_gslt b/functions/fn_install_gslt new file mode 100644 index 000000000..e03b356b1 --- /dev/null +++ b/functions/fn_install_gslt @@ -0,0 +1,42 @@ +#!/bin/bash +# LGSM fn_install_gslt function +# Author: Daniel Gibbs +# Website: http://gameservermanagers.com +lgsm_version="091215" + +# Description: Configures GSLT. + +if [ -z "${autoinstall}" ]; then + echo "" + echo "Game Server Login Token" + echo "============================" + sleep 1 + if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then + echo "GSLT is required to run a public ${gamename} server" + else + echo "GSLT is an optional feature for ${gamename} server" + fi + + echo "Get more info and a token here:" + echo "http://gameservermanagers.com/gslt" + echo "" + echo "Enter token below (Can be blank)." + echo -n "GSLT TOKEN: " + read token + sed -i -e "s/gslt=\"\"/gslt=\"${token}\"/g" "${rootdir}/${selfname}" + sleep 1 + echo "The GSLT can be changed by editing ${selfname}." + echo "" +else + if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then + fn_printinfomationnl "GSLT is required to run a public ${gamename} server" + else + fn_printinfomationnl "GSLT is an optional feature for ${gamename} server" + fi + echo "Get more info and a token here:" + echo "http://gameservermanagers.com/gslt" + echo "" + sleep 1 + echo "The GSLT can be changed by editing ${selfname}." + sleep 1 +fi \ No newline at end of file diff --git a/functions/fn_install_gsquery b/functions/fn_install_gsquery index 896e01eff..3f5bfcebf 100644 --- a/functions/fn_install_gsquery +++ b/functions/fn_install_gsquery @@ -2,7 +2,7 @@ # LGSM fn_install_gsquery function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 051115 +lgsm_version="061115" fn_dlgsquery(){ cd "${rootdir}" diff --git a/functions/fn_install_header b/functions/fn_install_header index f7c730a9c..42daa46cd 100644 --- a/functions/fn_install_header +++ b/functions/fn_install_header @@ -2,7 +2,7 @@ # LGSM fn_install_header function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 210115 +lgsm_version="061115" clear echo "=================================" diff --git a/functions/fn_install_kffix b/functions/fn_install_kffix index 634169b87..b3e484a2f 100644 --- a/functions/fn_install_kffix +++ b/functions/fn_install_kffix @@ -2,7 +2,7 @@ # LGSM fn_install_kffix function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 150515 +lgsm_version="061115" echo "Applying ${gamename} Server Fixes" echo "=================================" diff --git a/functions/fn_install_logs b/functions/fn_install_logs index a4e3c8562..7cb81e9ab 100644 --- a/functions/fn_install_logs +++ b/functions/fn_install_logs @@ -2,7 +2,7 @@ # LGSM fn_install_logs function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 281015 +lgsm_version="061115" if [ "${checklogs}" != "1" ]; then echo "" diff --git a/functions/fn_install_retry b/functions/fn_install_retry index 7146327e1..e7a90cbb8 100644 --- a/functions/fn_install_retry +++ b/functions/fn_install_retry @@ -2,7 +2,7 @@ # LGSM fn_install_retry function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 051115 +lgsm_version="061115" while true; do read -e -i "y" -p "Retry install? [Y/n]" yn diff --git a/functions/fn_install_rofix b/functions/fn_install_rofix index 8e187d7ca..9e636d50b 100644 --- a/functions/fn_install_rofix +++ b/functions/fn_install_rofix @@ -2,7 +2,7 @@ # LGSM fn_install_rofix function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 150515 +lgsm_version="061115" echo "Applying ${gamename} Server Fixes" echo "=================================" diff --git a/functions/fn_install_serverdir b/functions/fn_install_serverdir index db7692422..0a71af518 100644 --- a/functions/fn_install_serverdir +++ b/functions/fn_install_serverdir @@ -2,7 +2,7 @@ # LGSM fn_install_serverdir function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 240515 +lgsm_version="061115" echo "" echo "Server Directory" diff --git a/functions/fn_install_serverfiles b/functions/fn_install_serverfiles index 961106370..f75e14fe1 100644 --- a/functions/fn_install_serverfiles +++ b/functions/fn_install_serverfiles @@ -2,7 +2,7 @@ # LGSM fn_install_serverfiles function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 051115 +lgsm_version="061115" fn_steaminstallcommand(){ fn_check_steamuser @@ -10,6 +10,10 @@ counter="0" while [ "${counter}" == "0" ]||[ "$(grep -wc 0x402 .fn_install_serverfiles.tmp)" -ge "1" ]||[ "$(grep -wc 0x406 .fn_install_serverfiles.tmp)" -ge "1" ]||[ "$(grep -wc 0x6 .fn_install_serverfiles.tmp)" -ge "1" ]||[ "$(grep -wc 0x106 .fn_install_serverfiles.tmp)" -ge "1" ]; do counter=$((counter+1)) cd "${rootdir}/steamcmd" + ./steamcmd.sh +quit > /dev/null 2>&1 + if [[ $? != 0 ]]; then + fn_printfailurenl "Cannot start SteamCMD. Are dependencies installed?" + fi if [ "${counter}" -le "10" ]; then # Attempt 1-4: Standard attempt # Attempt 5-6: Validate attempt diff --git a/functions/fn_install_steamcmd b/functions/fn_install_steamcmd index 852bd652e..8709413b0 100644 --- a/functions/fn_install_steamcmd +++ b/functions/fn_install_steamcmd @@ -2,7 +2,7 @@ # LGSM fn_check_steamcmd function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 210115 +lgsm_version="061115" # Description: Downloads SteamCMD on install and checks if missing before running functions that require SteamCMD diff --git a/functions/fn_install_steamfix b/functions/fn_install_steamfix index 9dd88173d..501ac2fa4 100644 --- a/functions/fn_install_steamfix +++ b/functions/fn_install_steamfix @@ -2,7 +2,7 @@ # LGSM fn_install_steamfix function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 210115 +lgsm_version="061115" fn_steamclientfix(){ echo "" @@ -12,6 +12,9 @@ sleep 1 mkdir -pv "${HOME}/.steam" mkdir -pv "${HOME}/.steam/sdk32" cp -v "${rootdir}/steamcmd/linux32/steamclient.so" "${HOME}/.steam/sdk32/steamclient.so" + if [[ $? != 0 ]]; then + fn_printfailurenl "Cannot start apply steamclient.so fix." + fi sleep 1 } @@ -29,6 +32,9 @@ elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then mkdir "${HOME}/.steam/bin32" cp -v "${filesdir}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" fi +if [[ $? != 0 ]]; then + fn_printfailurenl "Cannot start apply libsteam.so fix." +fi sleep 1 } diff --git a/functions/fn_install_ts3 b/functions/fn_install_ts3 index bde40acfe..25605f588 100644 --- a/functions/fn_install_ts3 +++ b/functions/fn_install_ts3 @@ -2,7 +2,7 @@ # LGSM fn_install_ts3 function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +lgsm_version="061115" fn_details_distro # Gets the teamspeak server architecture diff --git a/functions/fn_install_ut2k4 b/functions/fn_install_ut2k4 index 1571b7610..fc25a09a8 100644 --- a/functions/fn_install_ut2k4 +++ b/functions/fn_install_ut2k4 @@ -2,7 +2,7 @@ # LGSM fn_install_ut2k4 function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 210115 +lgsm_version="061115" echo "Installing ${gamename} Server" echo "=================================" diff --git a/functions/fn_install_ut2k4filesdl b/functions/fn_install_ut2k4filesdl index 91e743e32..8120b26aa 100644 --- a/functions/fn_install_ut2k4filesdl +++ b/functions/fn_install_ut2k4filesdl @@ -2,7 +2,7 @@ # LGSM fn_install_ut2k4filesdl function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 210115 +lgsm_version="061115" echo "Downloading Server Files" echo "=================================" diff --git a/functions/fn_install_ut2k4fix b/functions/fn_install_ut2k4fix index 7d0859f1e..825f4e703 100644 --- a/functions/fn_install_ut2k4fix +++ b/functions/fn_install_ut2k4fix @@ -2,7 +2,7 @@ # LGSM fn_install_ut2k4fix function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 150515 +lgsm_version="061115" echo "Applying ${gamename} Server Fixes" echo "=================================" diff --git a/functions/fn_install_ut2k4key b/functions/fn_install_ut2k4key index bf0307af0..63e7c58be 100644 --- a/functions/fn_install_ut2k4key +++ b/functions/fn_install_ut2k4key @@ -2,7 +2,7 @@ # LGSM fn_install_ut2k4key function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 210115 +lgsm_version="061115" echo "Enter ${gamename} CD Key" echo "=================================" diff --git a/functions/fn_install_ut99 b/functions/fn_install_ut99 index 399aef031..d27e41f4c 100644 --- a/functions/fn_install_ut99 +++ b/functions/fn_install_ut99 @@ -2,7 +2,7 @@ # LGSM fn_install_ut99 function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 210115 +lgsm_version="061115" echo "Installing ${gamename} Server" echo "=================================" diff --git a/functions/fn_install_ut99filesdl b/functions/fn_install_ut99filesdl index 1ae92c090..265e60078 100644 --- a/functions/fn_install_ut99filesdl +++ b/functions/fn_install_ut99filesdl @@ -2,7 +2,7 @@ # LGSM fn_install_ut99filesdl function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 210115 +lgsm_version="061115" echo "Downloading Server Files" echo "=================================" diff --git a/functions/fn_install_ut99fix b/functions/fn_install_ut99fix index e888f876b..1147934b0 100644 --- a/functions/fn_install_ut99fix +++ b/functions/fn_install_ut99fix @@ -2,7 +2,7 @@ # LGSM fn_install_ut99fix function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 070215 +lgsm_version="061115" echo "Applying ${gamename} Server Fixes" echo "=================================" diff --git a/functions/fn_logs b/functions/fn_logs index f3b3b0ef1..d5b650bc0 100644 --- a/functions/fn_logs +++ b/functions/fn_logs @@ -2,7 +2,7 @@ # LGSM fn_logs function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 030715 +lgsm_version="061115" # Description: Acts as a log rotater, removing old logs. diff --git a/functions/fn_messages b/functions/fn_messages index 173b42c80..be23430b9 100644 --- a/functions/fn_messages +++ b/functions/fn_messages @@ -2,7 +2,7 @@ # LGSM fn_messages function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 260115 +lgsm_version="061115" # Description: Defines on-screen messages such as [ OK ] and how script logs look. @@ -127,3 +127,12 @@ fn_printerror(){ fn_printerrornl(){ echo -e "\e[0;31mError!\e[0m $@" } + +# Info! +fn_printinfomation(){ + echo -en "\e[0;36mInfo!\e[0m $@" +} + +fn_printinfomationnl(){ + echo -e "\e[0;36mInfo!\e[0m $@" +} diff --git a/functions/fn_monitor b/functions/fn_monitor index 3978aa43d..02380440e 100644 --- a/functions/fn_monitor +++ b/functions/fn_monitor @@ -2,7 +2,7 @@ # LGSM fn_monitor function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +lgsm_version="061115" # Description: Monitors server by checking for running proccesses # then passes to fn_monitor_query. diff --git a/functions/fn_monitor_query b/functions/fn_monitor_query index f56b6cf23..7f508cdf4 100644 --- a/functions/fn_monitor_query +++ b/functions/fn_monitor_query @@ -2,7 +2,7 @@ # LGSM fn_monitor_query function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +lgsm_version="061115" # Description: uses gsquery.py to directly query the server. # Detects if the server has frozen. diff --git a/functions/fn_start b/functions/fn_start index 66d9ae355..3adfe77ab 100644 --- a/functions/fn_start +++ b/functions/fn_start @@ -2,7 +2,7 @@ # LGSM fn_start function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 301015 +lgsm_version="061115" # Description: Starts the server. @@ -63,6 +63,7 @@ if [ "${ts3status}" = "Server seems to have died" ] || [ "${ts3status}" = "No se fn_printfailnl "Unable to start ${servername}" fn_scriptlog "Unable to start ${servername}" echo -e " Check log files: ${rootdir}/log" + exit 1 else fn_printok "${servername}" fn_scriptlog "Started ${servername}" @@ -188,6 +189,7 @@ if [ "${tmuxwc}" -eq 0 ]; then fi fi fi +exit 1 else fn_printok "${servername}" fn_scriptlog "Started ${servername}" diff --git a/functions/fn_stop b/functions/fn_stop index c5c36c2b3..2a02510c1 100644 --- a/functions/fn_stop +++ b/functions/fn_stop @@ -2,7 +2,7 @@ # LGSM fn_stop function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 261015 +lgsm_version="061115" # Description: Stops the server. diff --git a/functions/fn_update_check b/functions/fn_update_check index 8ccda2105..7f175ecc6 100644 --- a/functions/fn_update_check +++ b/functions/fn_update_check @@ -2,7 +2,7 @@ # LGSM fn_update_check function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 011115 +lgsm_version="061115" # Description: Checks if a server update is available. diff --git a/functions/fn_update_dl b/functions/fn_update_dl index b22bc7d95..835727cd0 100644 --- a/functions/fn_update_dl +++ b/functions/fn_update_dl @@ -2,7 +2,7 @@ # LGSM fn_update_dl function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 311015 +lgsm_version="061115" # Description: Runs a server update. diff --git a/functions/fn_update_functions b/functions/fn_update_functions index 731085485..c000578d0 100644 --- a/functions/fn_update_functions +++ b/functions/fn_update_functions @@ -2,7 +2,7 @@ # LGSM fn_update_functions function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 190515 +lgsm_version="061115" # Description: Deletes the functions dir to allow re-downloading of functions from GitHub. diff --git a/functions/fn_validate b/functions/fn_validate index 8ca411660..238640958 100644 --- a/functions/fn_validate +++ b/functions/fn_validate @@ -2,7 +2,7 @@ # LGSM fn_validate function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 040715 +lgsm_version="061115" # Description: Runs a server validation. diff --git a/tests/test.sh b/tests/tests_jc2server.sh similarity index 83% rename from tests/test.sh rename to tests/tests_jc2server.sh index 531066649..c9926eb06 100644 --- a/tests/test.sh +++ b/tests/tests_jc2server.sh @@ -1,9 +1,9 @@ #!/bin/bash -# Just Cause 2 +# TravisCI Tests # Server Management Script # Author: Daniel Gibbs # Website: http://gameservermanagers.com -version="150715" +version="071115" #### Variables #### @@ -34,9 +34,8 @@ gamename="Just Cause 2" engine="avalanche" # Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/jc2server" -mkdir "${rootdir}" -selfname="$(basename $0)" +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" @@ -88,28 +87,36 @@ fn_runfunction fn_functions -getopt=$1 - -fn_currentstatus(){ +fn_currentstatus_tmux(){ pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") -if [ "${pid}" == "0" ]; then - currentstatus="OFFLINE" +if [ "${pid}" != "0" ]; then + currentstatus="ONLINE" else + currentstatus="OFFLINE" +fi +} + +fn_currentstatus_ts3(){ +ts3status=$(${executable} status servercfgfullpathfile=${servercfgfullpath}) + +if [ "${ts3status}" == "Server is running" ]; then currentstatus="ONLINE" +else + currentstatus="OFFLINE" fi } fn_setstatus(){ - fn_currentstatus - + fn_currentstatus_tmux echo"" echo "Required status: ${requiredstatus}" counter=0 + echo "Current status: ${currentstatus}" while [ "${requiredstatus}" != "${currentstatus}" ]; do counter=$((counter+1)) - fn_currentstatus - - echo -ne "Current status: ${currentstatus}\\r" + fn_currentstatus_tmux + echo -ne "New status: ${currentstatus}\\r" + if [ "${requiredstatus}" == "ONLINE" ]; then (fn_start > /dev/null 2>&1) else @@ -120,10 +127,10 @@ fn_setstatus(){ echo "Current status: ${currentstatus}" echo "" echo "Unable to start or stop server." - exit + exit 1 fi done - echo -ne "Current status: ${currentstatus}\\r" + echo -ne "New status: ${currentstatus}\\r" echo -e "\n" echo "Test starting:" echo "" @@ -139,25 +146,35 @@ echo "=================================" echo "" sleep 1 echo "=================================" -echo "Generic Server Tests" +echo "Server Tests" echo "Using: ${gamename}" echo "=================================" echo "" sleep 1 -mkdir ${rootfdir} +mkdir ${rootdir} + echo "1.0 - start - no files" echo "=================================" echo "Description:" -echo "Test script reaction to missing server files." -requiredstatus="OFFLINE" -fn_setstatus +echo "test script reaction to missing server files." +echo "" (fn_start) echo "" echo "Test complete!" sleep 1 echo "" +echo "1.1 - getopt" +echo "=================================" +echo "Description:" +echo "displaying options messages." +echo "" +(fn_getopt) +echo "" +echo "Test complete!" +sleep 1 +echo "" @@ -165,8 +182,6 @@ echo "2.0 - install" echo "=================================" echo "Description:" echo "install ${gamename} server." -requiredstatus="OFFLINE" -fn_setstatus fn_autoinstall echo "" echo "Test complete!" @@ -201,7 +216,7 @@ echo "3.3 - start - updateonstart" echo "=================================" echo "Description:" echo "will update server on start." -requiredstatus="ONLINE" +requiredstatus="OFFLINE" fn_setstatus ( updateonstart="on" @@ -411,7 +426,7 @@ echo "" echo "6.0 - details" echo "=================================" echo "Description:" -echo "gsquery.py will fail to query port." +echo "display details." requiredstatus="ONLINE" fn_setstatus fn_details @@ -421,65 +436,14 @@ sleep 1 echo "" echo "=================================" -echo "Generic Server Tests - Complete!" +echo "Server Tests - Complete!" echo "Using: ${gamename}" echo "=================================" echo "" +requiredstatus="OFFLINE" +fn_setstatus sleep 1 fn_printinfo "Tidying up directories." sleep 1 -rm -rfv ${rootdir} +rm -rfv ${serverfiles} echo "END" - -#!/bin/bash -# Teamspeak 3 -# Server Management Script -# Author: Daniel Gibbs -# Website: http://gameservermanagers.com -version="040715" - -#### Variables #### - -# Notification Email -# (on|off) -emailnotification="on" -email="me@Danielgibbs.co.uk" - -# Start Variables -updateonstart="off" - -# Server Details -gamename="Teamspeak 3" -servername="Teamspeak 3 Server" -servicename="ts3-server" - -# Directories -rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/ts3server" -selfname="$(basename $0)" -lockselfname=".${servicename}.lock" -filesdir="${rootdir}/serverfiles" -systemdir="${filesdir}" -executabledir="${filesdir}" -executable="./ts3server_startscript.sh" -servercfg="${servicename}.ini" -servercfgdir="${filesdir}" -servercfgfullpath="${servercfgdir}/${servercfg}" -backupdir="${rootdir}/backups" - -# Logging -logdays="7" -gamelogdir="${filesdir}/logs" -scriptlogdir="${rootdir}/log/script" - -scriptlog="${scriptlogdir}/${servicename}-script.log" -emaillog="${scriptlogdir}/${servicename}-email.log" - -scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" - - -echo "=================================" -echo "Generic Server Tests" -echo "Using: ${gamename}" -echo "=================================" -echo "" -sleep 1 \ No newline at end of file diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh new file mode 100644 index 000000000..783f544bb --- /dev/null +++ b/tests/tests_ts3server.sh @@ -0,0 +1,358 @@ +#!/bin/bash +# TravisCI Tests +# Server Management Script +# Author: Daniel Gibbs +# Website: http://gameservermanagers.com +version="071115" + +#### Variables #### + +# Notification Email +# (on|off) +emailnotification="on" +email="me@danielgibbs.co.uk" + +# Start Variables +updateonstart="off" + +# Server Details +gamename="Teamspeak 3" +servername="Teamspeak 3 Server" +servicename="ts3-server" + +# Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) +lockselfname=".${servicename}.lock" +filesdir="${rootdir}/serverfiles" +systemdir="${filesdir}" +executabledir="${filesdir}" +executable="./ts3server_startscript.sh" +servercfg="${servicename}.ini" +servercfgdir="${filesdir}" +servercfgfullpath="${servercfgdir}/${servercfg}" +backupdir="${rootdir}/backups" + +# Logging +logdays="7" +gamelogdir="${filesdir}/logs" +scriptlogdir="${rootdir}/log/script" + +scriptlog="${scriptlogdir}/${servicename}-script.log" +emaillog="${scriptlogdir}/${servicename}-email.log" + +scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" + +##### Script ##### +# Do not edit + +fn_runfunction(){ +# Functions are downloaded and run with this function +if [ ! -f "${rootdir}/functions/${functionfile}" ]; then + cd "${rootdir}" + if [ ! -d "functions" ]; then + mkdir functions + fi + cd functions + echo -e " loading ${functionfile}...\c" + wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- + chmod +x "${functionfile}" + cd "${rootdir}" +fi +source "${rootdir}/functions/${functionfile}" +} + +fn_functions(){ +# Functions are defined in fn_functions. +functionfile="${FUNCNAME}" +fn_runfunction +} + +fn_functions + +fn_currentstatus_tmux(){ +pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") +if [ "${pid}" != "0" ]; then + currentstatus="ONLINE" +else + currentstatus="OFFLINE" +fi +} + +fn_currentstatus_ts3(){ +ts3status=$(${executable} status servercfgfullpathfile=${servercfgfullpath}) + +if [ "${ts3status}" == "Server is running" ]; then + currentstatus="ONLINE" +else + currentstatus="OFFLINE" +fi +} + +fn_setstatus(){ + fn_currentstatus_ts3 + echo"" + echo "Required status: ${requiredstatus}" + counter=0 + echo "Current status: ${currentstatus}" + while [ "${requiredstatus}" != "${currentstatus}" ]; do + counter=$((counter+1)) + fn_currentstatus_ts3 + echo -ne "New status: ${currentstatus}\\r" + + if [ "${requiredstatus}" == "ONLINE" ]; then + (fn_start) + else + (fn_stop) + fi + if [ "${counter}" -gt "5" ]; then + currentstatus="FAIL" + echo "Current status: ${currentstatus}" + echo "" + echo "Unable to start or stop server." + exit 1 + fi + done + echo -ne "New status: ${currentstatus}\\r" + echo -e "\n" + echo "Test starting:" + echo "" + sleep 0.5 +} + +echo "=================================" +echo "TravisCI Tests" +echo "Linux Game Server Manager" +echo "by Daniel Gibbs" +echo "http://gameservermanagers.com" +echo "=================================" +echo "" +sleep 1 +echo "=================================" +echo "Server Tests" +echo "Using: ${gamename}" +echo "=================================" +echo "" +sleep 1 + + + +echo "1.0 - start - no files" +echo "=================================" +echo "Description:" +echo "test script reaction to missing server files." +echo "" +(fn_start) +echo "" +echo "Test complete!" +sleep 1 +echo "" +echo "1.1 - getopt" +echo "=================================" +echo "Description:" +echo "displaying options messages." +echo "" +(fn_getopt) +echo "" +echo "Test complete!" +sleep 1 +echo "" + + + +echo "2.0 - install" +echo "=================================" +echo "Description:" +echo "install ${gamename} server." +fn_autoinstall +echo "" +echo "Test complete!" +sleep 1 +echo "" + + + +echo "3.1 - start" +echo "=================================" +echo "Description:" +echo "start ${gamename} server." +requiredstatus="OFFLINE" +fn_setstatus +fn_start +echo "" +echo "Test complete!" +sleep 1 +echo "" +echo "3.2 - start - online" +echo "=================================" +echo "Description:" +echo "start ${gamename} server while already running." +requiredstatus="ONLINE" +fn_setstatus +(fn_start) +echo "" +echo "Test complete!" +sleep 1 +echo "" +echo "3.3 - start - updateonstart" +echo "=================================" +echo "Description:" +echo "will update server on start." +requiredstatus="OFFLINE" +fn_setstatus +( + updateonstart="on" + fn_start +) +echo "" +echo "Test complete!" +sleep 1 +echo "" +echo "3.4 - stop" +echo "=================================" +echo "Description:" +echo "stop ${gamename} server." +requiredstatus="ONLINE" +fn_setstatus +fn_stop +echo "" +echo "Test complete!" +sleep 1 +echo "" +echo "3.5 - stop - offline" +echo "=================================" +echo "Description:" +echo "stop ${gamename} server while already stopped." +requiredstatus="OFFLINE" +fn_setstatus +(fn_stop) +echo "" +echo "Test complete!" +sleep 1 +echo "" +echo "3.6 - restart" +echo "=================================" +echo "Description:" +echo "restart ${gamename}." +requiredstatus="ONLINE" +fn_setstatus +fn_restart +echo "" +echo "Test complete!" +sleep 1 +echo "" +echo "3.7 - restart - offline" +echo "=================================" +echo "Description:" +echo "restart ${gamename} while already stopped." +requiredstatus="OFFLINE" +fn_setstatus +fn_restart +echo "" +echo "Test complete!" +sleep 1 +echo "" + + + +echo "4.1 - update" +echo "=================================" +echo "Description:" +echo "check for updates." +requiredstatus="OFFLINE" +fn_setstatus +fn_update_check +echo "" +echo "Test complete!" +sleep 1 +echo "" +echo "4.1 - update - old version" +echo "=================================" +echo "Description:" +echo "change the version number tricking LGSM to update." +requiredstatus="OFFLINE" +sed -i 's/[0-9]\+/0/g' ${gamelogdir}/ts3server*_0.log +fn_setstatus +fn_update_check +echo "" +echo "Test complete!" +sleep 1 +echo "" + +echo "5.1 - monitor - online" +echo "=================================" +echo "Description:" +echo "run monitor server while already running." +requiredstatus="ONLINE" +fn_setstatus +(fn_monitor) +echo "" +echo "Test complete!" +sleep 1 +echo "" +echo "5.2 - monitor - offline - no lockfile" +echo "=================================" +echo "Description:" +echo "run monitor while server is offline with no lockfile." +requiredstatus="OFFLINE" +fn_setstatus +(fn_monitor) +echo "" +echo "Test complete!" +sleep 1 +echo "" +echo "5.3 - monitor - offline - with lockfile" +echo "=================================" +echo "Description:" +echo "run monitor while server is offline with no lockfile." +requiredstatus="OFFLINE" +fn_setstatus +fn_printinfonl "creating lockfile." +date > "${rootdir}/${lockselfname}" +(fn_monitor) +echo "" +echo "Test complete!" +sleep 1 +echo "" +echo "5.4 - monitor - gsquery.py failure" +echo "=================================" +echo "Description:" +echo "gsquery.py will fail to query port." +requiredstatus="ONLINE" +fn_setstatus +sed -i 's/[0-9]\+/0/' "${servercfgfullpath}" +(fn_monitor) +echo "" +fn_printinfonl "Reseting ${servercfg}." +fn_install_config +echo "" +echo "Test complete!" +sleep 1 +echo "" + + + +echo "6.0 - details" +echo "=================================" +echo "Description:" +echo "display details." +requiredstatus="ONLINE" +fn_setstatus +fn_details +echo "" +echo "Test complete!" +sleep 1 +echo "" + +echo "=================================" +echo "Server Tests - Complete!" +echo "Using: ${gamename}" +echo "=================================" +echo "" +requiredstatus="OFFLINE" +fn_setstatus +sleep 1 +fn_printinfo "Tidying up directories." +sleep 1 +rm -rfv ${serverfiles} +echo "END" \ No newline at end of file