diff --git a/7DaysToDie/sdtdserver b/7DaysToDie/sdtdserver index b3112820c..bce6242dc 100644 --- a/7DaysToDie/sdtdserver +++ b/7DaysToDie/sdtdserver @@ -2,22 +2,29 @@ # 7 Days To Die # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="username" steampass="password" @@ -28,7 +35,7 @@ updateonstart="off" # http://7daystodie.gamepedia.com/Server fn_parms(){ -parms="-configfile=${servercfgfullpath} -dedicated" +parms="-logfile ${gamelogdir}/output_log__`date +%Y-%m-%d__%H-%M-%S`.txt -quit -batchmode -nographics -dedicated -configfile=${servercfgfullpath}" } #### Advanced Variables #### @@ -52,10 +59,12 @@ engine="unity3d" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" -executable="./startserver.sh" +executable="./7DaysToDieServer.x86" servercfg="${servicename}.xml" servercfgdir="${filesdir}" servercfgfullpath="${servercfgdir}/${servercfg}" @@ -67,6 +76,7 @@ logdays="7" gamelogdir="${rootdir}/log/server" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" gamelog="${gamelogdir}/${servicename}-game.log" scriptlog="${scriptlogdir}/${servicename}-script.log" @@ -79,57 +89,63 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curl}" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" + exit 1 fi + chmod +x "${filedir}/${filename}" fi -if [ "${exec}" ]; then - source "${filepath}" -fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 core_getopt.sh - diff --git a/ARKSurvivalEvolved/arkserver b/ARKSurvivalEvolved/arkserver index 2304ef566..263c61a37 100644 --- a/ARKSurvivalEvolved/arkserver +++ b/ARKSurvivalEvolved/arkserver @@ -2,32 +2,45 @@ # ARK: Survivial Evolved # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" # Start Variables +servername="ark-server" +port="7778" +queryport="27015" +rconport="32330" +rconpassword="" # Set to enable rcon +maxplayers="50" ip="0.0.0.0" updateonstart="off" fn_parms(){ -parms="TheIsland?listen" + parms="TheIsland?listen?MultiHome=${ip}?SessionName=${servername}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port}?ServerAdminPassword=${rconpassword}" } #### Advanced Variables #### @@ -51,6 +64,8 @@ engine="unreal4" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/ShooterGame" executabledir="${systemdir}/Binaries/Linux" @@ -66,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -77,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/Arma3/arma3server b/Arma3/arma3server index ff296e3bc..ae9c53ac0 100644 --- a/Arma3/arma3server +++ b/Arma3/arma3server @@ -3,22 +3,29 @@ # Server Management Script # Author: Daniel Gibbs # Contributor: Scarsz -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="username" steampass="password" @@ -71,6 +78,8 @@ engine="realvirtuality" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" @@ -89,6 +98,7 @@ logdays="7" #gamelogdir="" # No server logs available scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -100,55 +110,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/BlackMesa/bmdmserver b/BlackMesa/bmdmserver index 7601f826a..433f4a648 100644 --- a/BlackMesa/bmdmserver +++ b/BlackMesa/bmdmserver @@ -2,22 +2,29 @@ # Black Mesa: Deathmatch # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -31,9 +38,14 @@ 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: https://gameservermanagers.com/gslt +gslt="" + # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server fn_parms(){ -parms="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +parms="-game bms -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" } #### Advanced Variables #### @@ -57,6 +69,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/bms" executabledir="${filesdir}" @@ -72,6 +86,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +98,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curl}" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" + exit 1 fi + chmod +x "${filedir}/${filename}" fi -if [ "${exec}" ]; then - source "${filepath}" -fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/BladeSymphony/bsserver b/BladeSymphony/bsserver index 87f1ff2ee..37972923f 100644 --- a/BladeSymphony/bsserver +++ b/BladeSymphony/bsserver @@ -2,22 +2,29 @@ # Blade Symphony # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="username" steampass="password" @@ -57,6 +64,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/berimbau" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/BrainBread2/bb2server b/BrainBread2/bb2server index a78fdbc5a..bbf95484e 100644 --- a/BrainBread2/bb2server +++ b/BrainBread2/bb2server @@ -2,22 +2,29 @@ # BrainBread 2 # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="090116" +version="030616" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="username" steampass="password" @@ -31,9 +38,9 @@ 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 +# Optional: Game Server Login Token +# GSLT can be used for running a public server. +# More info: https://gameservermanagers.com/gslt gslt="" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server @@ -51,7 +58,7 @@ githubrepo="linuxgsm" githubbranch="master" # Steam -appid="346330" +appid="475370" # Server Details servicename="bb2-server" @@ -62,6 +69,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/brainbread2" executabledir="${filesdir}" @@ -77,6 +86,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -88,55 +98,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/CodenameCURE/ccserver b/CodenameCURE/ccserver new file mode 100644 index 000000000..0699139bc --- /dev/null +++ b/CodenameCURE/ccserver @@ -0,0 +1,155 @@ +#!/bin/bash +# Codename CURE +# Server Management Script +# Author: Daniel Gibbs +# Website: https://gameservermanagers.com +if [ -f ".dev-debug" ]; then + exec 5>dev-debug.log + BASH_XTRACEFD="5" + set -x +fi + +version="210516" + +#### Variables #### + +# Notification Alerts +# (on|off) + +# Email +emailalert="off" +email="email@example.com" + +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + +# Steam login +steamuser="anonymous" +steampass="" + +# Start Variables +defaultmap="cbe_bunker" +maxplayers="6" +port="27015" +sourcetvport="27020" +clientport="27005" +ip="0.0.0.0" +updateonstart="off" + +# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server +fn_parms(){ +parms="-game cure -insecure -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +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="383410" + +# Server Details +servicename="cc-server" +gamename="Codename CURE" +engine="source" + +# Directories +rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" +selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" +lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" +filesdir="${rootdir}/serverfiles" +systemdir="${filesdir}/cure" +executabledir="${filesdir}" +executable="./srcds_run" +servercfg="${servicename}.cfg" +servercfgdir="${systemdir}/cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/lgsm-default.cfg" +backupdir="${rootdir}/backups" + +# Logging +logdays="7" +gamelogdir="${systemdir}/logs" +scriptlogdir="${rootdir}/log/script" +consolelogdir="${rootdir}/log/console" +consolelogging="on" + +scriptlog="${scriptlogdir}/${servicename}-script.log" +consolelog="${consolelogdir}/${servicename}-console.log" +emaillog="${scriptlogdir}/${servicename}-email.log" + +scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" +consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" + +##### Script ##### +# Do not edit + +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then + if [ ! -d "${filedir}" ]; then + mkdir -p "${filedir}" + fi + echo -e " fetching ${filename}...\c" + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else + echo -e "\e[0;31mFAIL\e[0m\n" + echo "Curl is not installed!" + echo -e "" + exit 1 + fi + chmod +x "${filedir}/${filename}" +fi +source "${filedir}/${filename}" +} + +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl +} + +core_functions.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl +} + +core_dl.sh +core_functions.sh + +getopt=$1 +core_getopt.sh diff --git a/CodenameCURE/cfg/lgsm-default.cfg b/CodenameCURE/cfg/lgsm-default.cfg new file mode 100644 index 000000000..296c28ec8 --- /dev/null +++ b/CodenameCURE/cfg/lgsm-default.cfg @@ -0,0 +1,105 @@ +// **************************************************************************** +// * +// CodenameCURE - server.cfg * +// Version 100216 * +// * +// **************************************************************************** + +// ............................. Basic Settings ............................. // + +// Hostname for server. +hostname "" + +// RCON - remote console password. +rcon_password "" + +// Server password - for private servers. +sv_password "" + +// Contact email for server sysop. +sv_contact "email@example.com" + +// LAN Mode - If set the server will not show on the internet. +// Default: sv_lan 0 +sv_lan 0 + +// ............................... Map Cycles ............................... // +// info: There are several predefined mapcycles available that are listed below. +// You can also create your own custom mapcycle. + +// "mapcycle.txt" - all maps +mapcyclefile "mapcycle.txt" + +// ........................ Game Specific Commands ........................ // +// info: any commands that only apply to this game. + +// Difficulty +// 0 - Easy +// 1 - Average +// 2 - Skilled +// 3 - Insane +sv_difficulty "1" + +// Server tags - Tags show up on the in-game server browser. This helps +// users filter servers. +// vanilla - he server runs the default settings. +// custom - the server runs custom gameplay settings or mods. +// example: sv_tags "custom, fastdl" +sv_tags "" + +// ............................. Communication ............................. // + +// Enable communication over voice via microphone. +// Default: sv_voiceenable 1 +sv_voiceenable 1 + +// Players can hear all other players, no team restrictions. +// Default: sv_alltalk 0 +sv_alltalk 1 + +// ............................. Fast Download .............................. // +// info: Allows custom maps to be downloaded to the client. + +// Allows clients to download custom maps and textures etc. from the server at 20 kbps. +// Default: sv_allowdownload 1 +sv_allowdownload 1 + +// Allows clients to download custom maps, textures etc. from a web server with no transfer limit. +// Example: +// server location: maps/custommap.bsp +// web server location: http://example.com/custom/maps/custommap.bsp +// sv_downloadurl "http://example.com/custom" +// Default: sv_downloadurl "" +sv_downloadurl "" + +// ................................ Ban List ............................... // + +// personal banlist based on user IDs. +exec banned_user.cfg + +// personal banlist based on user IPs. +exec banned_ip.cfg + +writeid +writeip + +// ............................. Server Logging ............................. // + +//Enables logging to file, console, and udp < on | off >. +log on + +// Log server bans in the server logs. +// Default: sv_logbans 1 +sv_logbans 1 + +// Echo log information to the console. +// Default: sv_logecho 1 +sv_logecho 1 + +// Log server information in the log file. +// Default: sv_logfile 1 +sv_logfile 1 + +// Log server information to only one file. +// Default: sv_log_onefile 0 +sv_log_onefile 0 diff --git a/CounterStrike/csserver b/CounterStrike/csserver index 4fa7104d8..b03f7bcf2 100644 --- a/CounterStrike/csserver +++ b/CounterStrike/csserver @@ -2,22 +2,29 @@ # Counter Strike # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="goldsource" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/cstrike" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/CounterStrikeConditionZero/csczserver b/CounterStrikeConditionZero/csczserver index a6eca599c..31a875448 100644 --- a/CounterStrikeConditionZero/csczserver +++ b/CounterStrikeConditionZero/csczserver @@ -2,22 +2,29 @@ # Counter Strike: Condition Zero # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="goldsource" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/czero" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/CounterStrikeGlobalOffensive/csgoserver b/CounterStrikeGlobalOffensive/csgoserver index 64c2b0993..83a2b0cd0 100755 --- a/CounterStrikeGlobalOffensive/csgoserver +++ b/CounterStrikeGlobalOffensive/csgoserver @@ -2,22 +2,29 @@ # Counter Strike: Global Offensive # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -44,7 +51,7 @@ updateonstart="off" # Required: Game Server Login Token # GSLT is required for running a public server. -# More info: http://gameservermanagers.com/gslt +# More info: https://gameservermanagers.com/gslt gslt="" # Optional: Workshop Parameters @@ -80,6 +87,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/csgo" executabledir="${filesdir}" @@ -95,6 +104,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -106,55 +116,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/CounterStrikeSource/cssserver b/CounterStrikeSource/cssserver index 3efde2766..9daa48892 100644 --- a/CounterStrikeSource/cssserver +++ b/CounterStrikeSource/cssserver @@ -2,22 +2,29 @@ # Counter Strike: Source # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/cstrike" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/DayOfDefeat/dodserver b/DayOfDefeat/dodserver index 88ea3b92a..c547b53f4 100644 --- a/DayOfDefeat/dodserver +++ b/DayOfDefeat/dodserver @@ -2,22 +2,29 @@ # Day of Defeat # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="goldsource" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dod" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/DayOfDefeatSource/dodsserver b/DayOfDefeatSource/dodsserver index 5d80d01b0..68d2e7228 100644 --- a/DayOfDefeatSource/dodsserver +++ b/DayOfDefeatSource/dodsserver @@ -2,22 +2,29 @@ # Day of Defeat: Source # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dod" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/DeathmatchClassic/dmcserver b/DeathmatchClassic/dmcserver index 0b9efa02a..1b347d1bd 100644 --- a/DeathmatchClassic/dmcserver +++ b/DeathmatchClassic/dmcserver @@ -2,22 +2,29 @@ # Deathmatch Classic # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="goldsource" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dmc" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/DontStarveTogether/dstserver b/DontStarveTogether/dstserver index f6b0afe42..e7022e71b 100644 --- a/DontStarveTogether/dstserver +++ b/DontStarveTogether/dstserver @@ -2,22 +2,29 @@ # Dont Starve Together # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="130516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -26,12 +33,12 @@ steampass="" ip="0.0.0.0" updateonstart="off" - # Overworld: -conf_dir DST_Overworld # Cave: -conf_dir DST_Cave #http://dont-starve-game.wikia.com/wiki/Guides/Don%E2%80%99t_Starve_Together_Dedicated_Servers fn_parms(){ -parms="" +parms="-console -cluster MyDediServer -shard Master" +# -console -cluster MyDediServer -shard Master } #### Advanced Variables #### @@ -55,6 +62,8 @@ engine="dontstarve" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}/bin" @@ -70,6 +79,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -81,55 +91,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curl}" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" + exit 1 fi + chmod +x "${filedir}/${filename}" fi -if [ "${exec}" ]; then - source "${filepath}" -fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/DoubleActionBoogaloo/dabserver b/DoubleActionBoogaloo/dabserver index 00b8c70f6..f489912ca 100644 --- a/DoubleActionBoogaloo/dabserver +++ b/DoubleActionBoogaloo/dabserver @@ -2,22 +2,29 @@ # Double Action: Boogaloo # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -49,7 +56,7 @@ githubbranch="master" appid="317800" # Server Details -servicename="da-server" +servicename="dab-server" gamename="Double Action: Boogaloo" engine="source" @@ -57,6 +64,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/dab" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/FistfulOfFrags/fofserver b/FistfulOfFrags/fofserver index eaa85694f..d9759b866 100644 --- a/FistfulOfFrags/fofserver +++ b/FistfulOfFrags/fofserver @@ -2,22 +2,29 @@ # Fistful Of Frags # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/fof" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/GarrysMod/cfg/lgsm-default.cfg b/GarrysMod/cfg/lgsm-default.cfg index 2e61eb6a2..a1e2fd4d6 100644 --- a/GarrysMod/cfg/lgsm-default.cfg +++ b/GarrysMod/cfg/lgsm-default.cfg @@ -38,7 +38,7 @@ sv_allow_wait_command 0 sv_allow_voice_from_file 0 sv_turbophysics 0 sv_max_usercmd_future_ticks 12 -gmod_physiterations 2 +gmod_physiterations 4 sv_client_min_interp_ratio 1 sv_client_max_interp_ratio 2 think_limit 20 diff --git a/GarrysMod/gmodserver b/GarrysMod/gmodserver index 363eb01c8..c6ca902e4 100644 --- a/GarrysMod/gmodserver +++ b/GarrysMod/gmodserver @@ -2,22 +2,29 @@ # Garry's Mod # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -35,16 +42,21 @@ port="27015" sourcetvport="27020" clientport="27005" ip="0.0.0.0" +tickrate="66" updateonstart="off" +# Custom Start Parameters +# Default +r_hunkalloclightmaps 0, fixes a start issue on maps with many lights +customparms="+r_hunkalloclightmaps 0" + # Optional: Game Server Login Token # GSLT can be used for running a public server. -# More info: http://gameservermanagers.com/gslt +# More info: https://gameservermanagers.com/gslt gslt="" # https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server fn_parms(){ -parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} +host_workshop_collection ${workshopcollectionid} -authkey ${workshopauth} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate {tickrate} +host_workshop_collection ${workshopcollectionid} -authkey ${workshopauth} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers} ${customparms}" } #### Advanced Variables #### @@ -68,8 +80,11 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/garrysmod" +addonsdir="${systemdir}/addons" executabledir="${filesdir}" executable="./srcds_run" servercfg="${servicename}.cfg" @@ -83,6 +98,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -94,55 +110,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curl}" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" + exit 1 fi + chmod +x "${filedir}/${filename}" fi -if [ "${exec}" ]; then - source "${filepath}" -fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/GoldenEyeSource/gesserver b/GoldenEyeSource/gesserver index f473dcc57..f3231e6aa 100644 --- a/GoldenEyeSource/gesserver +++ b/GoldenEyeSource/gesserver @@ -2,24 +2,30 @@ # GoldenEye: Source # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" - set -x fi -version="271215" +version="210516" #### Variables #### export MALLOC_CHECK_=0 -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -46,7 +52,7 @@ parms="-game gesource -strictportbind -ip ${ip} -port ${port} +clientport ${clie githubuser="dgibbs64" githubrepo="linuxgsm" githubbranch="master" - + # Steam - 2007 SDK appid="310" @@ -59,6 +65,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/gesource" executabledir="${filesdir}" @@ -74,6 +82,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -85,56 +94,63 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 -core_getopt.sh \ No newline at end of file +core_getopt.sh diff --git a/HalfLife2Deathmatch/hl2dmserver b/HalfLife2Deathmatch/hl2dmserver index 271a024ef..7a42ce2df 100644 --- a/HalfLife2Deathmatch/hl2dmserver +++ b/HalfLife2Deathmatch/hl2dmserver @@ -2,22 +2,29 @@ # Half Life 2: Deathmatch # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/hl2mp" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/HalfLifeDeathmatch/hldmserver b/HalfLifeDeathmatch/hldmserver index b74914da1..c55237f74 100644 --- a/HalfLifeDeathmatch/hldmserver +++ b/HalfLifeDeathmatch/hldmserver @@ -2,22 +2,29 @@ # Half Life: Deathmatch # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -56,6 +63,8 @@ engine="goldsource" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/valve" executabledir="${filesdir}" @@ -71,6 +80,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -82,55 +92,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/HalfLifeDeathmatchSource/hldmsserver b/HalfLifeDeathmatchSource/hldmsserver index 33b2d0723..06459e25d 100644 --- a/HalfLifeDeathmatchSource/hldmsserver +++ b/HalfLifeDeathmatchSource/hldmsserver @@ -2,22 +2,29 @@ # Half-Life Deathmatch: Source # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/hl1mp" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/Hurtworld/hwserver b/Hurtworld/hwserver index 3a019f6d5..a0f81c036 100644 --- a/Hurtworld/hwserver +++ b/Hurtworld/hwserver @@ -3,22 +3,29 @@ # Server Management Script # Author: Daniel Gibbs, # Contributor: UltimateByte -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -43,6 +50,7 @@ loadsave="" # Use unstable 64 bit server executable (O/1) x64mode="0" + # http://hurtworld.wikia.com/wiki/Hosting_A_Server fn_parms(){ parms="-batchmode -nographics -exec \"host ${port} ${map} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\" -logfile \"${logfile}\" " @@ -69,6 +77,8 @@ engine="unity3d" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" @@ -84,6 +94,7 @@ logdays="7" gamelogdir="${rootdir}/log/server" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" gamelog="${gamelogdir}/${servicename}-game.log" scriptlog="${scriptlogdir}/${servicename}-script.log" @@ -96,57 +107,63 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 core_getopt.sh - diff --git a/Insurgency/insserver b/Insurgency/insserver index 66e511149..58e9b0a0c 100644 --- a/Insurgency/insserver +++ b/Insurgency/insserver @@ -2,22 +2,29 @@ # Insurgency # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -59,10 +66,12 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/insurgency" executabledir="${filesdir}" -executable="./srcds_linux" +executable="./srcds_run" servercfg="${servicename}.cfg" servercfgdir="${systemdir}/cfg" servercfgfullpath="${servercfgdir}/${servercfg}" @@ -74,6 +83,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -85,55 +95,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/JustCause2/jc2server b/JustCause2/jc2server index 5435a3121..63e15f5c5 100644 --- a/JustCause2/jc2server +++ b/JustCause2/jc2server @@ -2,22 +2,29 @@ # Just Cause 2 # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -50,6 +57,9 @@ engine="avalanche" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" +libdir="${lgsmdir}/lib" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" @@ -65,6 +75,7 @@ logdays="7" #gamelogdir="" # No server logs available scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -76,55 +87,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/KillingFloor/kfserver b/KillingFloor/kfserver index 2aa5af27b..24a8c1fb1 100644 --- a/KillingFloor/kfserver +++ b/KillingFloor/kfserver @@ -2,22 +2,29 @@ # Killing Floor # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="username" steampass="password" @@ -56,6 +63,8 @@ engine="unreal2" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/System" executabledir="${systemdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${rootdir}/log/server" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" gamelog="${gamelogdir}/${servicename}-game.log" scriptlog="${scriptlogdir}/${servicename}-script.log" @@ -85,55 +95,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/Left4Dead/l4dserver b/Left4Dead/l4dserver index 519ab1379..165cf7176 100644 --- a/Left4Dead/l4dserver +++ b/Left4Dead/l4dserver @@ -3,22 +3,29 @@ # Server Management Script # Author: Daniel Gibbs # Contributor: Summit Singh Thakur -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/left4dead" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/Left4Dead2/l4d2server b/Left4Dead2/l4d2server index 6c966cb6e..d7801dc2e 100644 --- a/Left4Dead2/l4d2server +++ b/Left4Dead2/l4d2server @@ -2,22 +2,32 @@ # Left 4 Dead 2 # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + +# Pushover +#Push alot + # Steam login steamuser="anonymous" steampass="" @@ -56,6 +66,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/left4dead2" executabledir="${filesdir}" @@ -71,6 +83,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -82,55 +95,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curl}" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" + exit 1 fi + chmod +x "${filedir}/${filename}" fi -if [ "${exec}" ]; then - source "${filepath}" -fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/Mumble/mumbleserver b/Mumble/mumbleserver index c0bfa4692..5f30b6fa8 100644 --- a/Mumble/mumbleserver +++ b/Mumble/mumbleserver @@ -2,22 +2,29 @@ # Mumble # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Server Details gamename="Mumble" servicename="mumble-server" @@ -26,6 +33,8 @@ servicename="mumble-server" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" @@ -40,6 +49,7 @@ logdays="7" logdir="${rootdir}/log" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -62,57 +72,63 @@ githubbranch="master" ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit - fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${curl}" - echo -e "${githuburl}\n" - exit - else - echo -e "\e[0;32mOK\e[0m" - fi - if [ "${exec}" ]; then - chmod +x "${filepath}" + exit 1 fi + chmod +x "${filedir}/${filename}" fi -if [ "${exec}" ]; then - source "${filepath}" -fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 core_getopt.sh - diff --git a/NS2Combat/ns2cserver b/NS2Combat/ns2cserver index a5683bf81..f23677000 100644 --- a/NS2Combat/ns2cserver +++ b/NS2Combat/ns2cserver @@ -2,22 +2,29 @@ # NS2: Combat # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="220416" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="username" steampass="password" @@ -32,8 +39,6 @@ servername="NS2C Server" webadminuser="admin" webadminpass="admin" webadminport="8080" -configpath="server1" -modstorage="server1/Workshop" mods="" password="" # Add the following line to the parms if you want a private server. Ensuring @@ -42,7 +47,7 @@ password="" # http://wiki.unknownworlds.com/ns2/Dedicated_Server fn_parms(){ -parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${rootdir}/${configpath}\" -modstorage \"${rootdir}/${modstorage}\" -mods \"${mods}\"" +parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" } #### Advanced Variables #### @@ -66,10 +71,15 @@ engine="spark" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}/ia32" executable="./ns2combatserver_linux32" +servercfgdir="${rootdir}/server1" +servercfgfullpath="${servercfgdir}" +modstoragedir="${servercfgdir}/Workshop" backupdir="${rootdir}/backups" # Logging @@ -77,6 +87,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -88,55 +99,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/NaturalSelection2/ns2server b/NaturalSelection2/ns2server index d53651b7f..70f4e7fd5 100644 --- a/NaturalSelection2/ns2server +++ b/NaturalSelection2/ns2server @@ -2,22 +2,29 @@ # Natural Selection 2 # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="220416" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="username" steampass="password" @@ -32,8 +39,6 @@ servername="NS2 Server" webadminuser="admin" webadminpass="admin" webadminport="8080" -configpath="server1" -modstorage="server1/Workshop" mods="" password="" # Add the following line to the parms if you want a private server. Ensuring @@ -42,7 +47,7 @@ password="" # http://wiki.unknownworlds.com/ns2/Dedicated_Server fn_parms(){ -parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${rootdir}/${configpath}\" -modstorage \"${rootdir}/${modstorage}\" -mods \"${mods}\"" +parms="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" } #### Advanced Variables #### @@ -66,10 +71,15 @@ engine="spark" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" executable="./server_linux32" +servercfgdir="${rootdir}/server1" +servercfgfullpath="${servercfgdir}" +modstoragedir="${servercfgdir}/Workshop" backupdir="${rootdir}/backups" # Logging @@ -77,6 +87,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -88,55 +99,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/NoMoreRoomInHell/nmrihserver b/NoMoreRoomInHell/nmrihserver index 26c836f2d..42296b71b 100644 --- a/NoMoreRoomInHell/nmrihserver +++ b/NoMoreRoomInHell/nmrihserver @@ -2,22 +2,29 @@ # No More Room in Hell # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/nmrih" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/OpposingForce/opforserver b/OpposingForce/opforserver index 61e9b4128..c329398fa 100644 --- a/OpposingForce/opforserver +++ b/OpposingForce/opforserver @@ -2,22 +2,29 @@ # Half-Life: Opposing Force # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="goldsource" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/gearbox" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/PiratesVikingandKnightsII/pvkiiserver b/PiratesVikingandKnightsII/pvkiiserver index 5a4588753..aa8e59f97 100644 --- a/PiratesVikingandKnightsII/pvkiiserver +++ b/PiratesVikingandKnightsII/pvkiiserver @@ -2,22 +2,29 @@ # No More Room in Hell # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" @@ -57,6 +64,8 @@ engine="source" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}/pvkii" executabledir="${filesdir}" @@ -72,6 +81,7 @@ logdays="7" gamelogdir="${systemdir}/logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/ProjectZomboid/cfg/servertest.ini b/ProjectZomboid/cfg/lgsm-default.ini similarity index 100% rename from ProjectZomboid/cfg/servertest.ini rename to ProjectZomboid/cfg/lgsm-default.ini diff --git a/ProjectZomboid/pzserver b/ProjectZomboid/pzserver index 701827e96..98d855ac6 100644 --- a/ProjectZomboid/pzserver +++ b/ProjectZomboid/pzserver @@ -3,25 +3,32 @@ # Server Management Script # Author: Daniel Gibbs # Contributions: Bryce Van Dyk (SingingTree) -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="210516" #### Variables #### -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" -steampass="password" +steampass="" # Start Variables ip="0.0.0.0" @@ -42,6 +49,9 @@ githubbranch="master" # Steam appid="380870" +# Allows for opting into the various Steam branches that PZ has to offer +# Example: -beta iwillbackupmysave -betapassword iaccepttheconsequences +branch="" # Server Details servicename="pz-server" @@ -52,6 +62,8 @@ engine="projectzomboid" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" @@ -59,6 +71,7 @@ executable="./start-server.sh" servercfg="servertest.ini" servercfgdir="${HOME}/Zomboid/Server" servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/lgsm-default.ini" backupdir="${rootdir}/backups" # Logging @@ -66,6 +79,7 @@ logdays="7" gamelogdir="${HOME}/Zomboid/Logs" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" scriptlog="${scriptlogdir}/${servicename}-script.log" consolelog="${consolelogdir}/${servicename}-console.log" @@ -77,55 +91,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/QuakeLive/qlserver b/QuakeLive/qlserver index ca7742e26..35d7be4f7 100755 --- a/QuakeLive/qlserver +++ b/QuakeLive/qlserver @@ -2,32 +2,40 @@ # Quake Live # Server Management Script # Author: Daniel Gibbs -# Website: http://gameservermanagers.com +# Website: https://gameservermanagers.com if [ -f ".dev-debug" ]; then exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi -version="271215" +version="060516" #### Variables #### -arch="x64" -# Notification Email +# Notification Alerts # (on|off) -emailnotification="off" + +# Email +emailalert="off" email="email@example.com" +# Pushbullet +# https://www.pushbullet.com/#settings +pushbulletalert="off" +pushbullettoken="accesstoken" + # Steam login steamuser="anonymous" steampass="" # Start Variables -gameport="27960" +arch="x64" # x64 or x86 +port="27960" rconport="28960" -rcon_password='ch@ng3me' -stats_password='ch@ng3me' +rconpassword="CHANGE_ME" +statsport="${port}" +statspassword="CHANGE_ME" mappool='mappool.txt' ip="0.0.0.0" updateonstart="off" @@ -35,7 +43,7 @@ updateonstart="off" # Install/Config Guide : https://steamcommunity.com/sharedfiles/filedetails/?id=542966946 # Console Commands : http://www.regurge.at/ql/ fn_parms(){ - parms="+set net_strict 1 +set net_ip ${ip} +set net_port ${gameport} +set fs_homepath ${filesdir}/${gameport} +set zmq_rcon_enable 1 +set zmq_rcon_port ${rconport} +set zmq_rcon_password ${rcon_password} +set zmq_stats_enable 1 +set zmq_stats_password ${stats_password} +set zmq_stats_port ${gameport} +set sv_mapPoolFile ${mappool} +exec ${servercfg} " + parms="+set net_strict 1 +set net_ip ${ip} +set net_port ${port} +set fs_homepath ${filesdir}/${port} +set zmq_rcon_enable 1 +set zmq_rcon_port ${rconport} +set zmq_rcon_password ${rconpassword} +set zmq_stats_enable 1 +set zmq_stats_password ${statspassword} +set zmq_stats_port ${statsport} +set sv_mapPoolFile ${mappool} +exec ${servercfg}" } #### Advanced Variables #### @@ -59,10 +67,12 @@ engine="idtech3" rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" lockselfname=".${servicename}.lock" +lgsmdir="${rootdir}/lgsm" +functionsdir="${lgsmdir}/functions" filesdir="${rootdir}/serverfiles" systemdir="${filesdir}" executabledir="${filesdir}" -executable=$([ "$arch" == 'x64' ] && echo "./run_server_x64.sh" || echo "./run_server_x86.sh") +executable=$([ "${arch}" == 'x64' ] && echo "./run_server_x64.sh" || echo "./run_server_x86.sh") servercfg="${servicename}.cfg" servercfgdir="${filesdir}/baseq3" servercfgfullpath="${servercfgdir}/${servercfg}" @@ -74,6 +84,7 @@ logdays="7" gamelogdir="${rootdir}/log/server" scriptlogdir="${rootdir}/log/script" consolelogdir="${rootdir}/log/console" +consolelogging="on" gamelog="${gamelogdir}/${servicename}-game.log" scriptlog="${scriptlogdir}/${servicename}-script.log" @@ -86,55 +97,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- ##### Script ##### # Do not edit -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 +# Fetches core_dl for file downloads +fn_fetch_core_dl(){ +github_file_url_dir="lgsm/functions" +github_file_url_name="${functionfile}" +filedir="${functionsdir}" +filename="${github_file_url_name}" +githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" +# If the file is missing, then download +if [ ! -f "${filedir}/${filename}" ]; then if [ ! -d "${filedir}" ]; then - mkdir "${filedir}" + mkdir -p "${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 - : - else + # Check curl exists and use available path + curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" + for curlcmd in ${curlpaths} + do + if [ -x "${curlcmd}" ]; then + break + fi + done + # If curl exists download file + if [ "$(basename ${curlcmd})" == "curl" ]; then + curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) + if [ $? -ne 0 ]; then + echo -e "\e[0;31mFAIL\e[0m\n" + echo "${curlfetch}" + echo -e "${githuburl}\n" + exit 1 + else + echo -e "\e[0;32mOK\e[0m" + fi + else echo -e "\e[0;31mFAIL\e[0m\n" echo "Curl is not installed!" echo -e "" - exit + exit 1 fi - curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) - if [ $? -ne 0 ]; then - echo -e "\e[0;31mFAIL\e[0m\n" - echo "${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}" + chmod +x "${filedir}/${filename}" fi +source "${filedir}/${filename}" } -fn_runfunction(){ - fn_getgithubfile "functions/${functionfile}" 1 +core_dl.sh(){ +# Functions are defined in core_functions.sh. +functionfile="${FUNCNAME}" +fn_fetch_core_dl } core_functions.sh(){ # Functions are defined in core_functions.sh. functionfile="${FUNCNAME}" -fn_runfunction +fn_fetch_core_dl } +core_dl.sh core_functions.sh getopt=$1 diff --git a/README.md b/README.md index 6b7056b55..6d395dafb 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@

Linux Game Server Managers_

-linux Game Server Managers +linux Game Server Managers [![Build Status](https://travis-ci.org/dgibbs64/linuxgsm.svg?branch=master)](https://travis-ci.org/dgibbs64/linuxgsm) [![Under Development](https://badge.waffle.io/dgibbs64/linuxgsm.svg?label=Under%20Development&title=Under%20Development)](http://waffle.io/dgibbs64/linuxgsm) -The Linux Game Server Managers are command line tools for quick, simple deployment and management of various dedicated game servers and voice comms servers. +The Linux Game Server Managers are command line tools for quick, simple deployment and management of various dedicated game servers and voice alert servers.

Hassle-Free Dedicated Servers

Game servers traditionally are not easy to manage yourself. Admins often have to spend hours just messing around trying to get their server working. LGSM is designed to be a simple as possible allowing Admins to spend less time on management and more time on the fun stuff. @@ -15,7 +15,8 @@ Game servers traditionally are not easy to manage yourself. Admins often have to
  • Console
  • Details
  • Installer (SteamCMD)
  • -
  • Monitor (including email notification)
  • +
  • Monitor
  • +
  • Alerts (Email, Pushbullet)
  • Update (SteamCMD)
  • Start/Stop/Restart server
  • @@ -38,11 +39,11 @@ All FAQ can be found here.

    Donate

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

    Useful Links