167 changed files with 8068 additions and 7100 deletions
@ -2,22 +2,29 @@ |
|||||
# 7 Days To Die |
# 7 Days To Die |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="username" |
steamuser="username" |
||||
steampass="password" |
steampass="password" |
||||
@ -28,7 +35,7 @@ updateonstart="off" |
|||||
|
|
||||
# http://7daystodie.gamepedia.com/Server |
# http://7daystodie.gamepedia.com/Server |
||||
fn_parms(){ |
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 #### |
#### Advanced Variables #### |
||||
@ -52,10 +59,12 @@ engine="unity3d" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
executable="./startserver.sh" |
executable="./7DaysToDieServer.x86" |
||||
servercfg="${servicename}.xml" |
servercfg="${servicename}.xml" |
||||
servercfgdir="${filesdir}" |
servercfgdir="${filesdir}" |
||||
servercfgfullpath="${servercfgdir}/${servercfg}" |
servercfgfullpath="${servercfgdir}/${servercfg}" |
||||
@ -67,6 +76,7 @@ logdays="7" |
|||||
gamelogdir="${rootdir}/log/server" |
gamelogdir="${rootdir}/log/server" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
gamelog="${gamelogdir}/${servicename}-game.log" |
gamelog="${gamelogdir}/${servicename}-game.log" |
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
@ -79,57 +89,63 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
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 |
||||
|
chmod +x "${filedir}/${filename}" |
||||
fi |
fi |
||||
if [ "${exec}" ]; then |
source "${filedir}/${filename}" |
||||
source "${filepath}" |
|
||||
fi |
|
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
core_getopt.sh |
core_getopt.sh |
||||
|
|
||||
|
@ -2,22 +2,29 @@ |
|||||
# ARK: Survivial Evolved |
# ARK: Survivial Evolved |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -51,6 +58,8 @@ engine="unreal4" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/ShooterGame" |
systemdir="${filesdir}/ShooterGame" |
||||
executabledir="${systemdir}/Binaries/Linux" |
executabledir="${systemdir}/Binaries/Linux" |
||||
@ -66,6 +75,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -77,55 +87,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -3,22 +3,29 @@ |
|||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Contributor: Scarsz |
# Contributor: Scarsz |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="username" |
steamuser="username" |
||||
steampass="password" |
steampass="password" |
||||
@ -71,6 +78,8 @@ engine="realvirtuality" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -89,6 +98,7 @@ logdays="7" |
|||||
#gamelogdir="" # No server logs available |
#gamelogdir="" # No server logs available |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -100,55 +110,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Black Mesa: Deathmatch |
# Black Mesa: Deathmatch |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -33,7 +40,7 @@ updateonstart="off" |
|||||
|
|
||||
# Optional: Game Server Login Token |
# Optional: Game Server Login Token |
||||
# GSLT can be used for running a public server. |
# GSLT can be used for running a public server. |
||||
# More info: http://gameservermanagers.com/gslt |
# More info: https://gameservermanagers.com/gslt |
||||
gslt="" |
gslt="" |
||||
|
|
||||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
||||
@ -62,6 +69,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/bms" |
systemdir="${filesdir}/bms" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -77,6 +86,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -88,55 +98,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Blade Symphony |
# Blade Symphony |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="username" |
steamuser="username" |
||||
steampass="password" |
steampass="password" |
||||
@ -57,6 +64,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/berimbau" |
systemdir="${filesdir}/berimbau" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# BrainBread 2 |
# BrainBread 2 |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="090116" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="username" |
steamuser="username" |
||||
steampass="password" |
steampass="password" |
||||
@ -33,7 +40,7 @@ updateonstart="off" |
|||||
|
|
||||
# Optional: Game Server Login Token |
# Optional: Game Server Login Token |
||||
# GSLT can be used for running a public server. |
# GSLT can be used for running a public server. |
||||
# More info: http://gameservermanagers.com/gslt |
# More info: https://gameservermanagers.com/gslt |
||||
gslt="" |
gslt="" |
||||
|
|
||||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
||||
@ -62,6 +69,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/brainbread2" |
systemdir="${filesdir}/brainbread2" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -77,6 +86,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -88,55 +98,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Codename CURE |
# Codename CURE |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/cure" |
systemdir="${filesdir}/cure" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Counter Strike |
# Counter Strike |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="goldsource" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/cstrike" |
systemdir="${filesdir}/cstrike" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Counter Strike: Condition Zero |
# Counter Strike: Condition Zero |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="goldsource" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/czero" |
systemdir="${filesdir}/czero" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Counter Strike: Global Offensive |
# Counter Strike: Global Offensive |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -44,7 +51,7 @@ updateonstart="off" |
|||||
|
|
||||
# Required: Game Server Login Token |
# Required: Game Server Login Token |
||||
# GSLT is required for running a public server. |
# GSLT is required for running a public server. |
||||
# More info: http://gameservermanagers.com/gslt |
# More info: https://gameservermanagers.com/gslt |
||||
gslt="" |
gslt="" |
||||
|
|
||||
# Optional: Workshop Parameters |
# Optional: Workshop Parameters |
||||
@ -80,6 +87,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/csgo" |
systemdir="${filesdir}/csgo" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -95,6 +104,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -106,55 +116,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Counter Strike: Source |
# Counter Strike: Source |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/cstrike" |
systemdir="${filesdir}/cstrike" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Day of Defeat |
# Day of Defeat |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="goldsource" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/dod" |
systemdir="${filesdir}/dod" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Day of Defeat: Source |
# Day of Defeat: Source |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/dod" |
systemdir="${filesdir}/dod" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Deathmatch Classic |
# Deathmatch Classic |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="goldsource" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/dmc" |
systemdir="${filesdir}/dmc" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Dont Starve Together |
# Dont Starve Together |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="130516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -26,12 +33,12 @@ steampass="" |
|||||
ip="0.0.0.0" |
ip="0.0.0.0" |
||||
updateonstart="off" |
updateonstart="off" |
||||
|
|
||||
|
|
||||
# Overworld: -conf_dir DST_Overworld |
# Overworld: -conf_dir DST_Overworld |
||||
# Cave: -conf_dir DST_Cave |
# Cave: -conf_dir DST_Cave |
||||
#http://dont-starve-game.wikia.com/wiki/Guides/Don%E2%80%99t_Starve_Together_Dedicated_Servers |
#http://dont-starve-game.wikia.com/wiki/Guides/Don%E2%80%99t_Starve_Together_Dedicated_Servers |
||||
fn_parms(){ |
fn_parms(){ |
||||
parms="" |
parms="-console -cluster MyDediServer -shard Master" |
||||
|
# -console -cluster MyDediServer -shard Master |
||||
} |
} |
||||
|
|
||||
#### Advanced Variables #### |
#### Advanced Variables #### |
||||
@ -55,6 +62,8 @@ engine="dontstarve" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}/bin" |
executabledir="${filesdir}/bin" |
||||
@ -70,6 +79,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -81,55 +91,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
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 |
||||
|
chmod +x "${filedir}/${filename}" |
||||
fi |
fi |
||||
if [ "${exec}" ]; then |
source "${filedir}/${filename}" |
||||
source "${filepath}" |
|
||||
fi |
|
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Double Action: Boogaloo |
# Double Action: Boogaloo |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -49,7 +56,7 @@ githubbranch="master" |
|||||
appid="317800" |
appid="317800" |
||||
|
|
||||
# Server Details |
# Server Details |
||||
servicename="da-server" |
servicename="dab-server" |
||||
gamename="Double Action: Boogaloo" |
gamename="Double Action: Boogaloo" |
||||
engine="source" |
engine="source" |
||||
|
|
||||
@ -57,6 +64,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/dab" |
systemdir="${filesdir}/dab" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Fistful Of Frags |
# Fistful Of Frags |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/fof" |
systemdir="${filesdir}/fof" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Garry's Mod |
# Garry's Mod |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="130316" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -44,7 +51,7 @@ customparms="+r_hunkalloclightmaps 0" |
|||||
|
|
||||
# Optional: Game Server Login Token |
# Optional: Game Server Login Token |
||||
# GSLT can be used for running a public server. |
# GSLT can be used for running a public server. |
||||
# More info: http://gameservermanagers.com/gslt |
# More info: https://gameservermanagers.com/gslt |
||||
gslt="" |
gslt="" |
||||
|
|
||||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
||||
@ -73,6 +80,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/garrysmod" |
systemdir="${filesdir}/garrysmod" |
||||
addonsdir="${systemdir}/addons" |
addonsdir="${systemdir}/addons" |
||||
@ -89,6 +98,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -100,55 +110,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,24 +2,30 @@ |
|||||
# GoldenEye: Source |
# GoldenEye: Source |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
|
|
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
export MALLOC_CHECK_=0 |
export MALLOC_CHECK_=0 |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -59,6 +65,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/gesource" |
systemdir="${filesdir}/gesource" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -74,6 +82,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -85,56 +94,63 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
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 |
||||
|
chmod +x "${filedir}/${filename}" |
||||
fi |
fi |
||||
if [ "${exec}" ]; then |
source "${filedir}/${filename}" |
||||
source "${filepath}" |
|
||||
fi |
|
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
core_getopt.sh |
core_getopt.sh |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Half Life 2: Deathmatch |
# Half Life 2: Deathmatch |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/hl2mp" |
systemdir="${filesdir}/hl2mp" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Half Life: Deathmatch |
# Half Life: Deathmatch |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -56,6 +63,8 @@ engine="goldsource" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/valve" |
systemdir="${filesdir}/valve" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -71,6 +80,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -82,55 +92,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Half-Life Deathmatch: Source |
# Half-Life Deathmatch: Source |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/hl1mp" |
systemdir="${filesdir}/hl1mp" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -3,22 +3,29 @@ |
|||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs, |
# Author: Daniel Gibbs, |
||||
# Contributor: UltimateByte |
# Contributor: UltimateByte |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -43,6 +50,7 @@ loadsave="" |
|||||
# Use unstable 64 bit server executable (O/1) |
# Use unstable 64 bit server executable (O/1) |
||||
x64mode="0" |
x64mode="0" |
||||
|
|
||||
|
|
||||
# http://hurtworld.wikia.com/wiki/Hosting_A_Server |
# http://hurtworld.wikia.com/wiki/Hosting_A_Server |
||||
fn_parms(){ |
fn_parms(){ |
||||
parms="-batchmode -nographics -exec \"host ${port} ${map} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\" -logfile \"${logfile}\" " |
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]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) |
selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -84,6 +94,7 @@ logdays="7" |
|||||
gamelogdir="${rootdir}/log/server" |
gamelogdir="${rootdir}/log/server" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
gamelog="${gamelogdir}/${servicename}-game.log" |
gamelog="${gamelogdir}/${servicename}-game.log" |
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
@ -96,57 +107,63 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
if [ $? -ne 0 ]; then |
|
||||
echo -e "\e[0;31mFAIL\e[0m\n" |
|
||||
echo " ${curl}"|grep "curl:" |
|
||||
echo -e "${githuburl}\n" |
|
||||
exit |
|
||||
else |
|
||||
echo -e "\e[0;32mOK\e[0m" |
|
||||
fi |
|
||||
if [ "${exec}" ]; then |
|
||||
chmod +x "${filepath}" |
|
||||
fi |
|
||||
fi |
|
||||
if [ "${exec}" ]; then |
|
||||
source "${filepath}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
core_getopt.sh |
core_getopt.sh |
||||
|
|
||||
|
@ -2,22 +2,29 @@ |
|||||
# Insurgency |
# Insurgency |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -59,6 +66,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/insurgency" |
systemdir="${filesdir}/insurgency" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -74,6 +83,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -85,55 +95,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Just Cause 2 |
# Just Cause 2 |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -50,6 +57,9 @@ engine="avalanche" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
|
libdir="${lgsmdir}/lib" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -65,6 +75,7 @@ logdays="7" |
|||||
#gamelogdir="" # No server logs available |
#gamelogdir="" # No server logs available |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -76,55 +87,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Killing Floor |
# Killing Floor |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="username" |
steamuser="username" |
||||
steampass="password" |
steampass="password" |
||||
@ -56,6 +63,8 @@ engine="unreal2" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/System" |
systemdir="${filesdir}/System" |
||||
executabledir="${systemdir}" |
executabledir="${systemdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${rootdir}/log/server" |
gamelogdir="${rootdir}/log/server" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
gamelog="${gamelogdir}/${servicename}-game.log" |
gamelog="${gamelogdir}/${servicename}-game.log" |
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
@ -85,55 +95,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -3,22 +3,29 @@ |
|||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Contributor: Summit Singh Thakur |
# Contributor: Summit Singh Thakur |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/left4dead" |
systemdir="${filesdir}/left4dead" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,32 @@ |
|||||
# Left 4 Dead 2 |
# Left 4 Dead 2 |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
|
# Pushover |
||||
|
#Push alot |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -56,6 +66,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/left4dead2" |
systemdir="${filesdir}/left4dead2" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -71,6 +83,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -82,55 +95,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
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 |
||||
|
chmod +x "${filedir}/${filename}" |
||||
fi |
fi |
||||
if [ "${exec}" ]; then |
source "${filedir}/${filename}" |
||||
source "${filepath}" |
|
||||
fi |
|
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Mumble |
# Mumble |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Server Details |
# Server Details |
||||
gamename="Mumble" |
gamename="Mumble" |
||||
servicename="mumble-server" |
servicename="mumble-server" |
||||
@ -26,6 +33,8 @@ servicename="mumble-server" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -40,6 +49,7 @@ logdays="7" |
|||||
logdir="${rootdir}/log" |
logdir="${rootdir}/log" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -62,57 +72,63 @@ githubbranch="master" |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
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 |
||||
|
chmod +x "${filedir}/${filename}" |
||||
fi |
fi |
||||
if [ "${exec}" ]; then |
source "${filedir}/${filename}" |
||||
source "${filepath}" |
|
||||
fi |
|
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
core_getopt.sh |
core_getopt.sh |
||||
|
|
||||
|
@ -2,22 +2,29 @@ |
|||||
# NS2: Combat |
# NS2: Combat |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="220416" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="username" |
steamuser="username" |
||||
steampass="password" |
steampass="password" |
||||
@ -32,8 +39,6 @@ servername="NS2C Server" |
|||||
webadminuser="admin" |
webadminuser="admin" |
||||
webadminpass="admin" |
webadminpass="admin" |
||||
webadminport="8080" |
webadminport="8080" |
||||
configpath="server1" |
|
||||
modstorage="server1/Workshop" |
|
||||
mods="" |
mods="" |
||||
password="" |
password="" |
||||
# Add the following line to the parms if you want a private server. Ensuring |
# 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 |
# http://wiki.unknownworlds.com/ns2/Dedicated_Server |
||||
fn_parms(){ |
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 #### |
#### Advanced Variables #### |
||||
@ -66,10 +71,15 @@ engine="spark" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}/ia32" |
executabledir="${filesdir}/ia32" |
||||
executable="./ns2combatserver_linux32" |
executable="./ns2combatserver_linux32" |
||||
|
servercfgdir="${rootdir}/server1" |
||||
|
servercfgfullpath="${servercfgdir}" |
||||
|
modstoragedir="${servercfgdir}/Workshop" |
||||
backupdir="${rootdir}/backups" |
backupdir="${rootdir}/backups" |
||||
|
|
||||
# Logging |
# Logging |
||||
@ -77,6 +87,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -88,55 +99,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Natural Selection 2 |
# Natural Selection 2 |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="220416" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="username" |
steamuser="username" |
||||
steampass="password" |
steampass="password" |
||||
@ -32,8 +39,6 @@ servername="NS2 Server" |
|||||
webadminuser="admin" |
webadminuser="admin" |
||||
webadminpass="admin" |
webadminpass="admin" |
||||
webadminport="8080" |
webadminport="8080" |
||||
configpath="server1" |
|
||||
modstorage="server1/Workshop" |
|
||||
mods="" |
mods="" |
||||
password="" |
password="" |
||||
# Add the following line to the parms if you want a private server. Ensuring |
# 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 |
# http://wiki.unknownworlds.com/ns2/Dedicated_Server |
||||
fn_parms(){ |
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 #### |
#### Advanced Variables #### |
||||
@ -66,10 +71,15 @@ engine="spark" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
executable="./server_linux32" |
executable="./server_linux32" |
||||
|
servercfgdir="${rootdir}/server1" |
||||
|
servercfgfullpath="${servercfgdir}" |
||||
|
modstoragedir="${servercfgdir}/Workshop" |
||||
backupdir="${rootdir}/backups" |
backupdir="${rootdir}/backups" |
||||
|
|
||||
# Logging |
# Logging |
||||
@ -77,6 +87,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -88,55 +99,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# No More Room in Hell |
# No More Room in Hell |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/nmrih" |
systemdir="${filesdir}/nmrih" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Half-Life: Opposing Force |
# Half-Life: Opposing Force |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="goldsource" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/gearbox" |
systemdir="${filesdir}/gearbox" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# No More Room in Hell |
# No More Room in Hell |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/pvkii" |
systemdir="${filesdir}/pvkii" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -3,25 +3,32 @@ |
|||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Contributions: Bryce Van Dyk (SingingTree) |
# Contributions: Bryce Van Dyk (SingingTree) |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="password" |
steampass="" |
||||
|
|
||||
# Start Variables |
# Start Variables |
||||
ip="0.0.0.0" |
ip="0.0.0.0" |
||||
@ -55,6 +62,8 @@ engine="projectzomboid" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -62,6 +71,7 @@ executable="./start-server.sh" |
|||||
servercfg="servertest.ini" |
servercfg="servertest.ini" |
||||
servercfgdir="${HOME}/Zomboid/Server" |
servercfgdir="${HOME}/Zomboid/Server" |
||||
servercfgfullpath="${servercfgdir}/${servercfg}" |
servercfgfullpath="${servercfgdir}/${servercfg}" |
||||
|
servercfgdefault="${servercfgdir}/lgsm-default.ini" |
||||
backupdir="${rootdir}/backups" |
backupdir="${rootdir}/backups" |
||||
|
|
||||
# Logging |
# Logging |
||||
@ -69,6 +79,7 @@ logdays="7" |
|||||
gamelogdir="${HOME}/Zomboid/Logs" |
gamelogdir="${HOME}/Zomboid/Logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -80,55 +91,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,32 +2,39 @@ |
|||||
# Quake Live |
# Quake Live |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="190216" |
version="060516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
arch="x64" |
|
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
|
|
||||
# Start Variables |
# Start Variables |
||||
gameport="27960" |
arch="x64" # x64 or x86 |
||||
|
port="27960" |
||||
rconport="28960" |
rconport="28960" |
||||
rconpassword="CHANGE_ME" |
rconpassword="CHANGE_ME" |
||||
statsport="${gameport}" |
statsport="${port}" |
||||
statspassword="CHANGE_ME" |
statspassword="CHANGE_ME" |
||||
mappool='mappool.txt' |
mappool='mappool.txt' |
||||
ip="0.0.0.0" |
ip="0.0.0.0" |
||||
@ -36,7 +43,7 @@ updateonstart="off" |
|||||
# Install/Config Guide : https://steamcommunity.com/sharedfiles/filedetails/?id=542966946 |
# Install/Config Guide : https://steamcommunity.com/sharedfiles/filedetails/?id=542966946 |
||||
# Console Commands : http://www.regurge.at/ql/ |
# Console Commands : http://www.regurge.at/ql/ |
||||
fn_parms(){ |
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 ${rconpassword} +set zmq_stats_enable 1 +set zmq_stats_password ${statspassword} +set zmq_stats_port ${statsport} +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 #### |
#### Advanced Variables #### |
||||
@ -60,10 +67,12 @@ engine="idtech3" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${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" |
servercfg="${servicename}.cfg" |
||||
servercfgdir="${filesdir}/baseq3" |
servercfgdir="${filesdir}/baseq3" |
||||
servercfgfullpath="${servercfgdir}/${servercfg}" |
servercfgfullpath="${servercfgdir}/${servercfg}" |
||||
@ -75,6 +84,7 @@ logdays="7" |
|||||
gamelogdir="${rootdir}/log/server" |
gamelogdir="${rootdir}/log/server" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
gamelog="${gamelogdir}/${servicename}-game.log" |
gamelog="${gamelogdir}/${servicename}-game.log" |
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
@ -87,55 +97,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Red Orchestra: Ostfront 41-45 |
# Red Orchestra: Ostfront 41-45 |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="username" |
steamuser="username" |
||||
steampass="password" |
steampass="password" |
||||
@ -52,6 +59,8 @@ appid="223250" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/system" |
systemdir="${filesdir}/system" |
||||
executabledir="${systemdir}" |
executabledir="${systemdir}" |
||||
@ -68,6 +77,7 @@ logdays="7" |
|||||
gamelogdir="${rootdir}/log/server" |
gamelogdir="${rootdir}/log/server" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
gamelog="${gamelogdir}/${servicename}-game.log" |
gamelog="${gamelogdir}/${servicename}-game.log" |
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
@ -81,55 +91,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Ricochet |
# Ricochet |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="goldsource" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/ricochet" |
systemdir="${filesdir}/ricochet" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -3,22 +3,29 @@ |
|||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Contributor: UltimateByte (LGSM adaptation), Wulf (Information) |
# Contributor: UltimateByte (LGSM adaptation), Wulf (Information) |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="230215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login (not required) |
# Steam login (not required) |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -74,6 +81,8 @@ engine="unity3d" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) |
selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -90,6 +99,7 @@ logdays="7" |
|||||
gamelogdir="${rootdir}/log/server" |
gamelogdir="${rootdir}/log/server" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
gamelog="${gamelogdir}/${servicename}-game.log" |
gamelog="${gamelogdir}/${servicename}-game.log" |
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
@ -103,55 +113,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
if [ $? -ne 0 ]; then |
|
||||
echo -e "\e[0;31mFAIL\e[0m\n" |
|
||||
echo " ${curl}"|grep "curl:" |
|
||||
echo -e "${githuburl}\n" |
|
||||
exit |
|
||||
else |
|
||||
echo -e "\e[0;32mOK\e[0m" |
|
||||
fi |
|
||||
if [ "${exec}" ]; then |
|
||||
chmod +x "${filepath}" |
|
||||
fi |
|
||||
fi |
|
||||
if [ "${exec}" ]; then |
|
||||
source "${filepath}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Serious Sam 3: BFE |
# Serious Sam 3: BFE |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="121215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -52,6 +59,8 @@ engine="seriousengine35" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/Bin" |
systemdir="${filesdir}/Bin" |
||||
executable="./runSam3_DedicatedServer.sh" |
executable="./runSam3_DedicatedServer.sh" |
||||
@ -67,6 +76,7 @@ logdays="7" |
|||||
gamelogdir="${rootdir}/log/server" |
gamelogdir="${rootdir}/log/server" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
gamelog="${gamelogdir}/${servicename}-game.log" |
gamelog="${gamelogdir}/${servicename}-game.log" |
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
@ -80,55 +90,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Starbound |
# Starbound |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="username" |
steamuser="username" |
||||
steampass="password" |
steampass="password" |
||||
@ -51,6 +58,8 @@ engine="starbound" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}/linux64" |
executabledir="${filesdir}/linux64" |
||||
@ -65,6 +74,7 @@ logdays="7" |
|||||
gamelogdir="${filesdir}/giraffe_storage" |
gamelogdir="${filesdir}/giraffe_storage" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -76,55 +86,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Sven Co-op |
# Sven Co-op |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -56,6 +63,8 @@ engine="goldsource" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/svencoop" |
systemdir="${filesdir}/svencoop" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -71,6 +80,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -82,56 +92,63 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
core_getopt.sh |
core_getopt.sh |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Team Fortress 2 |
# Team Fortress 2 |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -33,7 +40,7 @@ updateonstart="off" |
|||||
|
|
||||
# Optional: Game Server Login Token |
# Optional: Game Server Login Token |
||||
# GSLT can be used for running a public server. |
# GSLT can be used for running a public server. |
||||
# More info: http://gameservermanagers.com/gslt |
# More info: https://gameservermanagers.com/gslt |
||||
gslt="" |
gslt="" |
||||
|
|
||||
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
# https://developer.valvesoftware.com/wiki/Command_Line_Options#Source_Dedicated_Server |
||||
@ -62,6 +69,8 @@ engine="source" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/tf" |
systemdir="${filesdir}/tf" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -77,6 +86,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -88,55 +98,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Team Fortress Classic |
# Team Fortress Classic |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="anonymous" |
steamuser="anonymous" |
||||
steampass="" |
steampass="" |
||||
@ -57,6 +64,8 @@ engine="goldsource" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/tfc" |
systemdir="${filesdir}/tfc" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -72,6 +81,7 @@ logdays="7" |
|||||
gamelogdir="${systemdir}/logs" |
gamelogdir="${systemdir}/logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -83,55 +93,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Teamspeak 3 |
# Teamspeak 3 |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="251215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Start Variables |
# Start Variables |
||||
updateonstart="off" |
updateonstart="off" |
||||
|
|
||||
@ -30,6 +37,8 @@ servicename="ts3-server" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -60,55 +69,62 @@ githubbranch="master" |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -3,22 +3,29 @@ |
|||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Contributor: Bryce Van Dyk (SingingTree) |
# Contributor: Bryce Van Dyk (SingingTree) |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="username" |
steamuser="username" |
||||
steampass="password" |
steampass="password" |
||||
@ -52,6 +59,8 @@ engine="teeworlds" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -67,6 +76,7 @@ logdays="7" |
|||||
gamelogdir="${rootdir}/log/server" |
gamelogdir="${rootdir}/log/server" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
gamelog="${gamelogdir}/${servicename}-game.log" |
gamelog="${gamelogdir}/${servicename}-game.log" |
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
@ -79,55 +89,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -3,22 +3,29 @@ |
|||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Contributor: Bryce Van Dyk (SingingTree) |
# Contributor: Bryce Van Dyk (SingingTree) |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="username" |
steamuser="username" |
||||
steampass="password" |
steampass="password" |
||||
@ -52,6 +59,8 @@ engine="terraria" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
executabledir="${filesdir}" |
executabledir="${filesdir}" |
||||
@ -67,6 +76,7 @@ logdays="7" |
|||||
#gamelogdir="" # Terraria Doesn't Have a Server Log |
#gamelogdir="" # Terraria Doesn't Have a Server Log |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -78,55 +88,62 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Unreal Tournament 2004 |
# Unreal Tournament 2004 |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="271215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Start Variables |
# Start Variables |
||||
defaultmap="DM-Rankin" |
defaultmap="DM-Rankin" |
||||
ip="0.0.0.0" |
ip="0.0.0.0" |
||||
@ -35,6 +42,8 @@ engine="unreal2" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/System" |
systemdir="${filesdir}/System" |
||||
executabledir="${systemdir}" |
executabledir="${systemdir}" |
||||
@ -51,6 +60,7 @@ logdays="7" |
|||||
gamelogdir="${rootdir}/log/server" |
gamelogdir="${rootdir}/log/server" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
gamelog="${gamelogdir}/${servicename}-game.log" |
gamelog="${gamelogdir}/${servicename}-game.log" |
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
@ -71,55 +81,62 @@ githubbranch="master" |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -2,22 +2,29 @@ |
|||||
# Unreal Tournament 99 |
# Unreal Tournament 99 |
||||
# Server Management Script |
# Server Management Script |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
if [ -f ".dev-debug" ]; then |
if [ -f ".dev-debug" ]; then |
||||
exec 5>dev-debug.log |
exec 5>dev-debug.log |
||||
BASH_XTRACEFD="5" |
BASH_XTRACEFD="5" |
||||
set -x |
set -x |
||||
fi |
fi |
||||
|
|
||||
version="121215" |
version="210516" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
# Notification Email |
# Notification Alerts |
||||
# (on|off) |
# (on|off) |
||||
emailnotification="off" |
|
||||
|
# Email |
||||
|
emailalert="off" |
||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
|
# Pushbullet |
||||
|
# https://www.pushbullet.com/#settings |
||||
|
pushbulletalert"off" |
||||
|
pushbullettoken="accesstoken" |
||||
|
|
||||
# Start Variables |
# Start Variables |
||||
defaultmap="DM-Deck16][" |
defaultmap="DM-Deck16][" |
||||
ip="0.0.0.0" |
ip="0.0.0.0" |
||||
@ -28,6 +35,13 @@ parms="server ${defaultmap}.unr ini=${servercfgfullpath}" |
|||||
|
|
||||
#### Advanced Variables #### |
#### Advanced Variables #### |
||||
|
|
||||
|
# Github Branch Select |
||||
|
# Allows for the use of different function files |
||||
|
# from a different repo and/or branch. |
||||
|
githubuser="dgibbs64" |
||||
|
githubrepo="linuxgsm" |
||||
|
githubbranch="master" |
||||
|
|
||||
# Server Details |
# Server Details |
||||
servicename="ut99-server" |
servicename="ut99-server" |
||||
gamename="Unreal Tournament 99" |
gamename="Unreal Tournament 99" |
||||
@ -37,6 +51,8 @@ engine="unreal" |
|||||
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
|
functionsdir="${lgsmdir}/functions" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}/System" |
systemdir="${filesdir}/System" |
||||
executabledir="${systemdir}" |
executabledir="${systemdir}" |
||||
@ -50,8 +66,10 @@ backupdir="${rootdir}/backups" |
|||||
|
|
||||
# Logging |
# Logging |
||||
logdays="7" |
logdays="7" |
||||
|
gamelogdir="${filesdir}/Logs" |
||||
scriptlogdir="${rootdir}/log/script" |
scriptlogdir="${rootdir}/log/script" |
||||
consolelogdir="${rootdir}/log/console" |
consolelogdir="${rootdir}/log/console" |
||||
|
consolelogging="on" |
||||
|
|
||||
scriptlog="${scriptlogdir}/${servicename}-script.log" |
scriptlog="${scriptlogdir}/${servicename}-script.log" |
||||
consolelog="${consolelogdir}/${servicename}-console.log" |
consolelog="${consolelogdir}/${servicename}-console.log" |
||||
@ -60,65 +78,65 @@ emaillog="${scriptlogdir}/${servicename}-email.log" |
|||||
scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" |
scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log" |
||||
consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" |
consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log" |
||||
|
|
||||
# Github Branch Select |
|
||||
# Allows for the use of different function files |
|
||||
# from a different repo and/or branch. |
|
||||
githubuser="dgibbs64" |
|
||||
githubrepo="linuxgsm" |
|
||||
githubbranch="master" |
|
||||
|
|
||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_getgithubfile(){ |
# Fetches core_dl for file downloads |
||||
filename=$1 |
fn_fetch_core_dl(){ |
||||
exec=$2 |
github_file_url_dir="lgsm/functions" |
||||
fileurl=${3:-$filename} |
github_file_url_name="${functionfile}" |
||||
filepath="${rootdir}/${filename}" |
filedir="${functionsdir}" |
||||
filedir=$(dirname "${filepath}") |
filename="${github_file_url_name}" |
||||
# If the function file is missing, then download |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" |
||||
if [ ! -f "${filepath}" ]; then |
# If the file is missing, then download |
||||
|
if [ ! -f "${filedir}/${filename}" ]; then |
||||
if [ ! -d "${filedir}" ]; then |
if [ ! -d "${filedir}" ]; then |
||||
mkdir "${filedir}" |
mkdir -p "${filedir}" |
||||
fi |
fi |
||||
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
|
||||
echo -e " fetching ${filename}...\c" |
echo -e " fetching ${filename}...\c" |
||||
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
# 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)" |
||||
else |
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 -e "\e[0;31mFAIL\e[0m\n" |
||||
echo "Curl is not installed!" |
echo "Curl is not installed!" |
||||
echo -e "" |
echo -e "" |
||||
exit |
exit 1 |
||||
fi |
fi |
||||
curl=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
chmod +x "${filedir}/${filename}" |
||||
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}" |
|
||||
fi |
fi |
||||
|
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
fn_runfunction(){ |
core_dl.sh(){ |
||||
fn_getgithubfile "functions/${functionfile}" 1 |
# Functions are defined in core_functions.sh. |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_functions.sh(){ |
core_functions.sh(){ |
||||
# Functions are defined in core_functions.sh. |
# Functions are defined in core_functions.sh. |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
|
core_dl.sh |
||||
core_functions.sh |
core_functions.sh |
||||
|
|
||||
getopt=$1 |
getopt=$1 |
||||
|
@ -1,90 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM check_steamcmd.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="160316" |
|
||||
|
|
||||
# Description: Checks SteamCMD is installed and correct. |
|
||||
|
|
||||
|
|
||||
fn_install_steamcmd(){ |
|
||||
echo "Installing steamCMD" |
|
||||
if [ ! -d "${steamcmddir}" ]; then |
|
||||
mkdir -v "${steamcmddir}" |
|
||||
fi |
|
||||
curl=$(curl --fail -o "${steamcmddir}/steamcmd_linux.tar.gz" "http://media.steampowered.com/client/steamcmd_linux.tar.gz" 2>&1) |
|
||||
exitcode=$? |
|
||||
echo -e "downloading steamcmd_linux.tar.gz...\c" |
|
||||
if [ $exitcode -eq 0 ]; then |
|
||||
fn_printokeol |
|
||||
else |
|
||||
fn_printfaileol |
|
||||
echo "${curl}" |
|
||||
echo -e "${githuburl}\n" |
|
||||
exit $exitcode |
|
||||
fi |
|
||||
tar --verbose -zxf "${steamcmddir}/steamcmd_linux.tar.gz" -C "${steamcmddir}" |
|
||||
rm -v "${steamcmddir}/steamcmd_linux.tar.gz" |
|
||||
chmod +x "${steamcmddir}/steamcmd.sh" |
|
||||
echo "" |
|
||||
} |
|
||||
|
|
||||
|
|
||||
fn_check_steamcmd_user(){ |
|
||||
# Checks steamuser is setup. |
|
||||
if [ "${steamuser}" == "username" ]; then |
|
||||
fn_printfailnl "Steam login not set. Update steamuser." |
|
||||
echo " * Change steamuser=\"username\" to a valid steam login." |
|
||||
if [ -d "${scriptlogdir}" ]; then |
|
||||
fn_scriptlog "edit ${selfname}. change steamuser=\"username\" to a valid steam login." |
|
||||
exit 1 |
|
||||
fi |
|
||||
fi |
|
||||
# Anonymous user is set if steamuser is missing |
|
||||
if [ -z "${steamuser}" ]; then |
|
||||
fn_printwarnnl "Steam login not set. Using anonymous login." |
|
||||
if [ -d "${scriptlogdir}" ]; then |
|
||||
fn_scriptlog "Steam login not set. Using anonymous login." |
|
||||
fi |
|
||||
steamuser="anonymous" |
|
||||
steampass="" |
|
||||
sleep 2 |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_check_steamcmd_sh(){ |
|
||||
# Checks if SteamCMD exists when starting or updating a server. |
|
||||
# Installs if missing. |
|
||||
steamcmddir="${rootdir}/steamcmd" |
|
||||
if [ ! -f "${steamcmddir}/steamcmd.sh" ]; then |
|
||||
if [ "${function_selfname}" == "command_install.sh" ]; then |
|
||||
fn_install_steamcmd |
|
||||
else |
|
||||
fn_printwarnnl "SteamCMD is missing" |
|
||||
fn_scriptlog "SteamCMD is missing" |
|
||||
sleep 1 |
|
||||
fn_install_steamcmd |
|
||||
fi |
|
||||
elif [ "${function_selfname}" == "command_install.sh" ]; then |
|
||||
fn_printinfomation "SteamCMD is already installed..." |
|
||||
fn_printokeol |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_check_steamcmd_guard(){ |
|
||||
if [ "${function_selfname}" == "command_update.sh" ]||[ "${function_selfname}" == "command_validate.sh" ]; then |
|
||||
# Checks that steamcmd is working correctly and will prompt Steam Guard if required. |
|
||||
"${steamcmddir}"/steamcmd.sh +login "${steamuser}" "${steampass}" +quit |
|
||||
if [ $? -ne 0 ]; then |
|
||||
fn_printfailurenl "Error running SteamCMD" |
|
||||
fi |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
if [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament 2004" ]||[ "${gamename}" == "Mumble" ]||[ "${gamename}" == "Teamspeak 3" ]; then |
|
||||
: # These servers do not require SteamCMD. Check is skipped. |
|
||||
else |
|
||||
fn_check_steamcmd_user |
|
||||
fn_check_steamcmd_sh |
|
||||
fn_check_steamcmd_guard |
|
||||
fi |
|
@ -1,23 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM check_steamuser.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
if [ "${steamuser}" == "username" ]; then |
|
||||
fn_printfailnl "Steam login not set. Update steamuser." |
|
||||
echo " * Change steamuser=\"username\" to a valid steam login." |
|
||||
if [ -d ${scriptlogdir} ]; then |
|
||||
fn_scriptlog "edit ${selfname}. change steamuser=\"username\" to a valid steam login." |
|
||||
exit 1 |
|
||||
fi |
|
||||
fi |
|
||||
if [ -z "${steamuser}" ]; then |
|
||||
fn_printwarnnl "Steam login not set. Using anonymous login." |
|
||||
if [ -d "${scriptlogdir}" ]; then |
|
||||
fn_scriptlog "Steam login not set. Using anonymous login." |
|
||||
fi |
|
||||
steamuser="anonymous" |
|
||||
steampass="" |
|
||||
sleep 2 |
|
||||
fi |
|
@ -1,681 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM command_details.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="230216" |
|
||||
|
|
||||
# Description: Displays server infomation. |
|
||||
|
|
||||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
||||
|
|
||||
# Standard Details |
|
||||
# This applies to all engines |
|
||||
|
|
||||
fn_details_os(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[93mDistro Details\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
{ |
|
||||
echo -e "\e[34mDistro:\t\e[0m${os}" |
|
||||
echo -e "\e[34mArch:\t\e[0m${arch}" |
|
||||
echo -e "\e[34mKernel:\t\e[0m${kernel}" |
|
||||
echo -e "\e[34mHostname:\t\e[0m$HOSTNAME" |
|
||||
echo -e "\e[34mtmux:\t\e[0m${tmuxv}" |
|
||||
echo -e "\e[34mGLIBC:\t\e[0m${glibcv}" |
|
||||
} | column -s $'\t' -t |
|
||||
} |
|
||||
|
|
||||
fn_details_performance(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[93mPerformance\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
{ |
|
||||
echo -e "\e[34mUptime:\t\e[0m${days}d, ${hours}h, ${minutes}m" |
|
||||
echo -e "\e[34mAvg Load:\t\e[0m${load}" |
|
||||
} | column -s $'\t' -t |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "\e[34mMem:\t\e[34mtotal\t used\t free\e[0m" |
|
||||
echo -e "\e[34mPhysical:\t\e[0m${physmemtotal}\t${physmemused}\t${physmemfree}\e[0m" |
|
||||
echo -e "\e[34mSwap:\t\e[0m${swaptotal}\t${swapused}\t${swapfree}\e[0m" |
|
||||
} | column -s $'\t' -t |
|
||||
} |
|
||||
|
|
||||
fn_details_disk(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[93mStorage\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
{ |
|
||||
echo -e "\e[34mFilesystem:\t\e[0m${filesystem}" |
|
||||
echo -e "\e[34mTotal:\t\e[0m${totalspace}" |
|
||||
echo -e "\e[34mUsed:\t\e[0m${usedspace}" |
|
||||
echo -e "\e[34mAvailable:\t\e[0m${availspace}" |
|
||||
echo -e "\e[34mServerfiles:\t\e[0m${filesdirdu}" |
|
||||
if [ -d "${backupdir}" ]; then |
|
||||
echo -e "\e[34mBackups:\t\e[0m${backupdirdu}" |
|
||||
fi |
|
||||
} | column -s $'\t' -t |
|
||||
} |
|
||||
|
|
||||
fn_details_gameserver(){ |
|
||||
echo -e "" |
|
||||
|
|
||||
## server details |
|
||||
echo -e "\e[92m${gamename} Server Details\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
{ |
|
||||
# server name |
|
||||
echo -e "\e[34mServer name:\t\e[0m${servername}" |
|
||||
|
|
||||
# server ip |
|
||||
echo -e "\e[34mServer IP:\t\e[0m${ip}:${port}" |
|
||||
|
|
||||
# rcon password |
|
||||
if [ -n "${rconpassword}" ]; then |
|
||||
echo -e "\e[34mRCON password:\t\e[0m${rconpassword}" |
|
||||
fi |
|
||||
|
|
||||
# server password |
|
||||
if [ -n "${serverpassword}" ]; then |
|
||||
echo -e "\e[34mServer password:\t\e[0m${serverpassword}" |
|
||||
fi |
|
||||
|
|
||||
# admin password |
|
||||
if [ -n "${adminpassword}" ]; then |
|
||||
echo -e "\e[34mAdmin password:\t\e[0m${adminpassword}" |
|
||||
fi |
|
||||
|
|
||||
# slots |
|
||||
if [ -n "${slots}" ]; then |
|
||||
echo -e "\e[34mSlots:\t\e[0m${slots}" |
|
||||
fi |
|
||||
|
|
||||
# game mode |
|
||||
if [ -n "${gamemode}" ]; then |
|
||||
echo -e "\e[34mGame mode:\t\e[0m${gamemode}" |
|
||||
fi |
|
||||
|
|
||||
# game world |
|
||||
if [ -n "${gameworld}" ]; then |
|
||||
echo -e "\e[34mGame world:\t\e[0m${gameworld}" |
|
||||
fi |
|
||||
|
|
||||
# tick rate |
|
||||
if [ -n "${tickrate}" ]; then |
|
||||
echo -e "\e[34mTick rate:\t\e[0m${tickrate}" |
|
||||
fi |
|
||||
|
|
||||
# online status |
|
||||
if [ "${gamename}" == "Teamspeak 3" ]; then |
|
||||
info_ts3status.sh |
|
||||
if [ "${ts3status}" = "Server seems to have died" ]||[ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then |
|
||||
echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m" |
|
||||
else |
|
||||
echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m" |
|
||||
fi |
|
||||
else |
|
||||
pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") |
|
||||
if [ "${pid}" == "0" ]; then |
|
||||
echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m" |
|
||||
else |
|
||||
echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m" |
|
||||
fi |
|
||||
fi |
|
||||
|
|
||||
# teamspeak dbplugin |
|
||||
if [ -n "${dbplugin}" ]; then |
|
||||
echo -e "\e[34mdbplugin:\t\e[0m${dbplugin}" |
|
||||
fi |
|
||||
} | column -s $'\t' -t |
|
||||
echo -e "" |
|
||||
|
|
||||
## script details |
|
||||
echo -e "\e[92m${selfname} Script Details\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
{ |
|
||||
# service name |
|
||||
echo -e "\e[34mService name:\t\e[0m${servicename}" |
|
||||
|
|
||||
# script version |
|
||||
if [ -n "${version}" ]; then |
|
||||
echo -e "\e[34m${selfname} version:\t\e[0m${version}" |
|
||||
fi |
|
||||
|
|
||||
# script user |
|
||||
echo -e "\e[34mUser:\t\e[0m$(whoami)" |
|
||||
|
|
||||
# GLIBC required |
|
||||
if [ -n "${glibcrequired}" ] && [ "${glibcrequired}" != "UNKNOWN" ]; then |
|
||||
if [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt "$(echo "${glibcrequired}" | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" ]; then |
|
||||
if [ "${glibcfix}" == "yes" ]; then |
|
||||
echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired} \e[0m(\e[0;32mUsing GLIBC fix\e[0m)" |
|
||||
else |
|
||||
echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired}\e[0m(\e[0;32mGLIBC version too old\e[0m)" |
|
||||
fi |
|
||||
else |
|
||||
echo -e "\e[34mGLIBC required:\t\e[0;32m${glibcrequired}\e[0m" |
|
||||
fi |
|
||||
fi |
|
||||
|
|
||||
# email notification |
|
||||
if [ -n "${emailnotification}" ]; then |
|
||||
echo -e "\e[34mEmail notification:\t\e[0m${emailnotification}" |
|
||||
fi |
|
||||
|
|
||||
# update on start |
|
||||
if [ -n "${updateonstart}" ]; then |
|
||||
echo -e "\e[34mUpdate on start:\t\e[0m${updateonstart}" |
|
||||
fi |
|
||||
|
|
||||
# script location |
|
||||
echo -e "\e[34mLocation:\t\e[0m${rootdir}" |
|
||||
|
|
||||
# config file location |
|
||||
if [ -n "${servercfgfullpath}" ]; then |
|
||||
echo -e "\e[34mConfig file:\t\e[0m${servercfgfullpath}" |
|
||||
fi |
|
||||
|
|
||||
# network config file location (ARMA 3) |
|
||||
if [ -n "${networkcfgfullpath}" ]; then |
|
||||
echo -e "\e[34mNetwork config file:\t\e[0m${networkcfgfullpath}" |
|
||||
fi |
|
||||
} | column -s $'\t' -t |
|
||||
} |
|
||||
|
|
||||
fn_details_backup(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mBackups\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then |
|
||||
echo -e "No Backups created" |
|
||||
else |
|
||||
{ |
|
||||
echo -e "\e[34mNo. of backups:\t\e[0m${backupcount}" |
|
||||
echo -e "\e[34mLatest backup:\e[0m" |
|
||||
echo -e "\e[34m date:\t\e[0m${lastbackupdate}" |
|
||||
echo -e "\e[34m file:\t\e[0m${lastbackup}" |
|
||||
echo -e "\e[34m size:\t\e[0m${lastbackupsize}" |
|
||||
} | column -s $'\t' -t |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_details_commandlineparms(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mCommand-line Parameters\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "${executable} ${parms}" |
|
||||
} |
|
||||
|
|
||||
fn_details_statusbottom(){ |
|
||||
echo -e "" |
|
||||
if [ "${gamename}" == "Teamspeak 3" ]; then |
|
||||
if [ "${ts3status}" = "Server seems to have died" ]||[ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then |
|
||||
echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m" |
|
||||
else |
|
||||
echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m" |
|
||||
fi |
|
||||
else |
|
||||
pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:") |
|
||||
if [ "${pid}" == "0" ]; then |
|
||||
echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m" |
|
||||
else |
|
||||
echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m" |
|
||||
fi |
|
||||
fi |
|
||||
echo -e "" |
|
||||
} |
|
||||
|
|
||||
# Engine Specific details |
|
||||
|
|
||||
fn_details_avalanche(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the parameters in" |
|
||||
echo -e "${servercfgfullpath}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep Jcmp-Server" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game\tINBOUND\t${port}\tudp" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_dontstarve(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the parameters in" |
|
||||
echo -e "${servercfgfullpath}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep dontstarve" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game\tINBOUND\t${port}\tudp" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_projectzomboid(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the parameters in" |
|
||||
echo -e "${servercfgfullpath}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep java" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game\tINBOUND\t${port}\tudp" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
|
|
||||
fn_details_realvirtuality(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the parameters in" |
|
||||
echo -e "${servercfgfullpath}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep arma3server" |
|
||||
echo -e "" |
|
||||
if [ -z "${port}" ]||[ -z "${queryport}" ]||[ -z "${masterport}" ]; then |
|
||||
echo -e "\e[0;31mERROR!\e[0m Missing/commented ports in ${servercfg}." |
|
||||
echo -e "" |
|
||||
fi |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game\tINBOUND\t${port}\tudp" |
|
||||
echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp" |
|
||||
echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_idtech3(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the parameters in" |
|
||||
echo -e "${servercfgfullpath}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep qzeroded" |
|
||||
echo -e "" |
|
||||
if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then |
|
||||
echo -e "\e[0;31mERROR!\e[0m Missing/commented ports in ${servercfg}." |
|
||||
echo -e "" |
|
||||
fi |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game\tINBOUND\t${port}\tudp" |
|
||||
echo -e "> Rcon\tINBOUND\t${rconport}\tudp" |
|
||||
echo -e "> Stats\tINBOUND\t${statsport}\tudp" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
|
|
||||
fn_details_seriousengine35(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the parameters in" |
|
||||
echo -e "${servercfgfullpath}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep Sam3_Dedicate" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game/RCON\tINBOUND\t${port}\ttcp" |
|
||||
echo -e "> Query\tINBOUND\t${queryport}\tudp" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_source(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the command-line" |
|
||||
echo -e "parameters in ${selfname}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep srcds_linux" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" |
|
||||
if [ -n "${sourcetvport}" ]; then |
|
||||
echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp" |
|
||||
fi |
|
||||
echo -e "< Client\tOUTBOUND\t${clientport}\tudp" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_spark(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the command-line" |
|
||||
echo -e "parameters in ${selfname}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep server_linux3" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game/RCON\tINBOUND\t${port}\tudp" |
|
||||
echo -e "> Query\tINBOUND\t${queryport}\tudp" |
|
||||
echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" |
|
||||
} | column -s $'\t' -t |
|
||||
echo -e "" |
|
||||
echo -e "\e[92m${servername} WebAdmin\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
{ |
|
||||
echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}/index.html" |
|
||||
echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}" |
|
||||
echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_starbound(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the command-line" |
|
||||
echo -e "parameters in ${selfname}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep starbound" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game\tINBOUND\t${port}\ttcp" |
|
||||
echo -e "> Query\tINBOUND\t${queryport}\ttcp" |
|
||||
echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
|
|
||||
} |
|
||||
|
|
||||
fn_details_teamspeak3(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the parameters in" |
|
||||
echo -e "${servercfgfullpath}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep ts3server" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Voice\tINBOUND\t${port}\tudp" |
|
||||
echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp" |
|
||||
echo -e "> File transfer\tINBOUND\t${fileport}\ttcp" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_teeworlds(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the command-line" |
|
||||
echo -e "parameters in ${servercfgfullpath}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep teeworlds_srv" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game\tINBOUND\t${port}\ttcp" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_terraria(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the command-line" |
|
||||
echo -e "parameters in ${servercfgfullpath}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep terraia" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game\tINBOUND\t${port}\ttcp" |
|
||||
echo -e "> Query\tINBOUND\t${queryport}\ttcp" |
|
||||
echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_sdtd(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the parameters in" |
|
||||
echo -e "${servercfgfullpath}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep 7DaysToDie" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game/RCON\tINBOUND\t${port}\tudp" |
|
||||
echo -e "> Query\tINBOUND\t${queryport}\tudp" |
|
||||
echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" |
|
||||
echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp" |
|
||||
} | column -s $'\t' -t |
|
||||
echo -e "" |
|
||||
echo -e "\e[92m${servername} WebAdmin\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
{ |
|
||||
echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}" |
|
||||
echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}" |
|
||||
echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" |
|
||||
} | column -s $'\t' -t |
|
||||
echo -e "" |
|
||||
echo -e "\e[92m${servername} Telnet\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
{ |
|
||||
echo -e "\e[34mTelnet enabled:\t\e[0m${telnetenabled}" |
|
||||
echo -e "\e[34mTelnet address:\t\e[0m${ip} ${telnetport}" |
|
||||
echo -e "\e[34mTelnet password:\t\e[0m${telnetpass}" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_hurtworld(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the parameters in" |
|
||||
echo -e "hwserver script" |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep Hurtworld" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game/RCON\tINBOUND\t${port}\tudp" |
|
||||
echo -e "> Query\tINBOUND\t${queryport}\tudp" |
|
||||
|
|
||||
} | column -s $'\t' -t |
|
||||
echo -e "" |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_rust(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the parameters in" |
|
||||
echo -e "rustserver script" |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep Rust" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" |
|
||||
echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp" |
|
||||
echo -e "> RCON\tINBOUND\t${rconport}\ttcp" |
|
||||
|
|
||||
} | column -s $'\t' -t |
|
||||
echo -e "" |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_unreal(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the parameters in" |
|
||||
echo -e "${servercfgfullpath}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep ucc-bin" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" |
|
||||
echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" |
|
||||
echo -e "> Query\tINBOUND\t${queryport}\tudp" |
|
||||
if [ "${engine}" == "unreal" ]; then |
|
||||
echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp" |
|
||||
fi |
|
||||
if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then |
|
||||
echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}" |
|
||||
fi |
|
||||
if [ "${appid}" == "215360" ]; then |
|
||||
echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp" |
|
||||
else |
|
||||
echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp" |
|
||||
fi |
|
||||
if [ "${appid}" ]; then |
|
||||
if [ "${appid}" == "223250" ]; then |
|
||||
echo -e "< Steam\tOUTBOUND\t20610\tudp" |
|
||||
else |
|
||||
echo -e "< Steam\tOUTBOUND\t20660\tudp" |
|
||||
fi |
|
||||
fi |
|
||||
echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" |
|
||||
} | column -s $'\t' -t |
|
||||
echo -e "" |
|
||||
echo -e "\e[92m${servername} WebAdmin\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
{ |
|
||||
echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}" |
|
||||
echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}" |
|
||||
echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}" |
|
||||
echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
fn_details_ark(){ |
|
||||
echo -e "" |
|
||||
echo -e "\e[92mPorts\e[0m" |
|
||||
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = |
|
||||
echo -e "Change ports by editing the parameters in" |
|
||||
echo -e "${servercfgfullpath}." |
|
||||
echo -e "" |
|
||||
echo -e "Useful port diagnostic command:" |
|
||||
echo -e "netstat -atunp | grep ShooterGame" |
|
||||
echo -e "" |
|
||||
{ |
|
||||
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" |
|
||||
echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" |
|
||||
echo -e "> Query\tINBOUND\t${queryport}\tudp" |
|
||||
} | column -s $'\t' -t |
|
||||
|
|
||||
fn_details_statusbottom |
|
||||
} |
|
||||
|
|
||||
|
|
||||
# Run checks and gathers details to display. |
|
||||
check.sh |
|
||||
info_config.sh |
|
||||
info_distro.sh |
|
||||
info_glibc.sh |
|
||||
fn_details_os |
|
||||
fn_details_performance |
|
||||
fn_details_disk |
|
||||
fn_details_gameserver |
|
||||
fn_details_backup |
|
||||
# Some game servers do not have parms. |
|
||||
if [ "${gamename}" != "Teamspeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then |
|
||||
fn_parms |
|
||||
fn_details_commandlineparms |
|
||||
fi |
|
||||
|
|
||||
# Display details depending on game or engine. |
|
||||
if [ "${engine}" == "avalanche" ]; then |
|
||||
fn_details_avalanche |
|
||||
elif [ "${engine}" == "dontstarve" ]; then |
|
||||
fn_details_dontstarve |
|
||||
elif [ "${engine}" == "projectzomboid" ]; then |
|
||||
fn_details_projectzomboid |
|
||||
elif [ "${engine}" == "idtech3" ]; then |
|
||||
fn_details_idtech3 |
|
||||
elif [ "${engine}" == "realvirtuality" ]; then |
|
||||
fn_details_realvirtuality |
|
||||
elif [ "${engine}" == "seriousengine35" ]; then |
|
||||
fn_details_seriousengine35 |
|
||||
elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then |
|
||||
fn_details_source |
|
||||
elif [ "${engine}" == "spark" ]; then |
|
||||
fn_details_spark |
|
||||
elif [ "${engine}" == "starbound" ]; then |
|
||||
fn_details_starbound |
|
||||
elif [ "${engine}" == "teeworlds" ]; then |
|
||||
fn_details_teeworlds |
|
||||
elif [ "${engine}" == "terraria" ]; then |
|
||||
fn_details_terraria |
|
||||
elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then |
|
||||
fn_details_unreal |
|
||||
elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then |
|
||||
fn_details_ark |
|
||||
elif [ "${gamename}" == "Hurtworld" ]; then |
|
||||
fn_details_hurtworld |
|
||||
elif [ "${gamename}" == "7 Days To Die" ]; then |
|
||||
fn_details_sdtd |
|
||||
elif [ "${gamename}" == "Teamspeak 3" ]; then |
|
||||
fn_details_teamspeak3 |
|
||||
elif [ "${gamename}" == "Rust" ]; then |
|
||||
fn_details_rust |
|
||||
else |
|
||||
fn_printerrornl "Unable to detect server engine." |
|
||||
fi |
|
@ -1,15 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM dev_debug.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="281215" |
|
||||
|
|
||||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
||||
|
|
||||
if [ -f ".dev-debug" ]; then |
|
||||
rm .dev-debug |
|
||||
fn_printoknl "Disabled dev-debug" |
|
||||
else |
|
||||
date > .dev-debug |
|
||||
fn_printoknl "Enabled dev-debug" |
|
||||
fi |
|
@ -1,22 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM command_email_test.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
# Description: Sends a test email notification. |
|
||||
|
|
||||
local modulename="Email" |
|
||||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
||||
check.sh |
|
||||
info_config.sh |
|
||||
if [ "${emailnotification}" = "on" ]; then |
|
||||
fn_scriptlog "Sending test notification" |
|
||||
subject="${servicename} Email Test Notification - Testing ${servername}" |
|
||||
failurereason="Testing ${servicename} email notification" |
|
||||
actiontaken="Sent test email...hello is this thing on?" |
|
||||
email.sh |
|
||||
else |
|
||||
fn_printfailnl "Notifications not enabled" |
|
||||
fn_scriptlog "Notifications not enabled" |
|
||||
fi |
|
@ -1,335 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM command_fastdl function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Contributor: UltimateByte |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="210216" |
|
||||
|
|
||||
# Description: Creates a FastDL folder |
|
||||
|
|
||||
local modulename="FastDL" |
|
||||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
||||
|
|
||||
check.sh |
|
||||
|
|
||||
# Directories |
|
||||
webdir="${rootdir}/www" |
|
||||
fastdldir="${webdir}/fastdl" |
|
||||
addonsdir="${systemdir}/addons" |
|
||||
# Server lua autorun dir, used to autorun lua on client connect to the server |
|
||||
luasvautorundir="${systemdir}/lua/autorun/server" |
|
||||
luafastdlfile="lgsm_cl_force_fastdl.lua" |
|
||||
luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" |
|
||||
|
|
||||
fn_check_bzip2(){ |
|
||||
# Returns true if not installed |
|
||||
if [ -z "$(command -v bzip2)" ]; then |
|
||||
bzip2installed="0" |
|
||||
fn_printinfo "bzip2 is not installed !" |
|
||||
fn_scriptlog "bzip2 is not installed" |
|
||||
echo -en "\n" |
|
||||
sleep 1 |
|
||||
echo "We advise using it" |
|
||||
echo "For more information, see https://github.com/dgibbs64/linuxgsm/wiki/FastDL#bzip2-compression" |
|
||||
sleep 2 |
|
||||
else |
|
||||
bzip2installed="1" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_fastdl_init(){ |
|
||||
# User confirmation |
|
||||
fn_printok "Welcome to LGSM's FastDL generator" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
fn_scriptlog "Started FastDL creation" |
|
||||
while true; do |
|
||||
read -e -i "y" -p "Continue? [Y/n]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) break;; |
|
||||
[Nn]* ) exit;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
fn_scriptlog "Initiating FastDL creation" |
|
||||
|
|
||||
# Check and create folders |
|
||||
if [ ! -d "${webdir}" ]; then |
|
||||
echo "" |
|
||||
fn_printinfo "Creating FastDL directories" |
|
||||
echo -en "\n" |
|
||||
sleep 1 |
|
||||
fn_printdots "Creating www directory" |
|
||||
sleep 0.5 |
|
||||
mkdir "${webdir}" |
|
||||
fn_printok "Created www directory" |
|
||||
fn_scriptlog "FastDL created www directory" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
fi |
|
||||
if [ ! -d "${fastdldir}" ]; then |
|
||||
# No folder, won't ask for removing old ones |
|
||||
newfastdl=1 |
|
||||
fn_printdots "Creating fastdl directory" |
|
||||
sleep 0.5 |
|
||||
mkdir "${fastdldir}" |
|
||||
fn_printok "Created fastdl directory" |
|
||||
fn_scriptlog "FastDL created fastdl directory" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
clearoldfastdl="off" # Nothing to clear |
|
||||
elif [ "$(ls -A "${fastdldir}")" ]; then |
|
||||
newfastdl=0 |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_fastdl_config(){ |
|
||||
# Global settings for FastDL creation |
|
||||
fn_printinfo "Entering configuration" |
|
||||
fn_scriptlog "Configuration" |
|
||||
sleep 2 |
|
||||
echo -en "\n" |
|
||||
# Prompt for clearing old files if folder was already here |
|
||||
if [ -n "${newfastdl}" ] && [ "${newfastdl}" == "0" ]; then |
|
||||
fn_printdots |
|
||||
while true; do |
|
||||
read -e -i "y" -p "Clear old FastDL files? [Y/n]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) clearoldfastdl="on"; fn_scriptlog "clearoldfastdl enabled"; fn_printok "Clearing Enabled"; break;; |
|
||||
[Nn]* ) clearoldfastdl="off"; fn_scriptlog "clearoldfastdl disabled"; fn_printok "Clearing Disabled"; break;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
echo -en "\n" |
|
||||
fi |
|
||||
# Prompt for using bzip2 if it's installed |
|
||||
if [ ${bzip2installed} == 1 ]; then |
|
||||
fn_printdots |
|
||||
while true; do |
|
||||
read -e -i "y" -p "Enable file compression using bzip2? [Y/n]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) bzip2enable="on"; fn_scriptlog "bzip2 enabled"; fn_printok "bzip2 Enabled"; break;; |
|
||||
[Nn]* ) bzip2enable="off"; fn_scriptlog "bzip2 disabled"; fn_printok "bzip2 Disabled"; break;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
echo -en "\n" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_fastdl_gmod_config(){ |
|
||||
# Prompt for download enforcer, that is using a .lua addfile resource generator |
|
||||
fn_printdots |
|
||||
while true; do |
|
||||
read -e -i "y" -p "Use client download enforcer? [Y/n]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) luaressource="on"; fn_scriptlog "DL enforcer Enabled"; fn_printok "Enforcer Enabled"; break;; |
|
||||
[Nn]* ) luaressource="off"; fn_scriptlog "DL enforcer Disabled"; fn_printok "Enforcer Disabled"; break;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
echo -en "\n" |
|
||||
} |
|
||||
|
|
||||
fn_clear_old_fastdl(){ |
|
||||
# Clearing old FastDL if user answered yes |
|
||||
if [ "${clearoldfastdl}" == "on" ]; then |
|
||||
fn_printinfo "Clearing existing FastDL folder" |
|
||||
fn_scriptlog "Clearing existing FastDL folder" |
|
||||
sleep 0.5 |
|
||||
rm -R "${fastdldir:?}"/* |
|
||||
fn_printok "Old FastDL folder cleared" |
|
||||
fn_scriptlog "Old FastDL folder cleared" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_gmod_fastdl(){ |
|
||||
# Copy all needed files for FastDL |
|
||||
echo "" |
|
||||
fn_printdots "Starting gathering all needed files" |
|
||||
fn_scriptlog "Starting gathering all needed files" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
|
|
||||
# No choice to cd to the directory, as find can't then display relative folder |
|
||||
cd "${systemdir}" |
|
||||
|
|
||||
# Map Files |
|
||||
fn_printdots "Copying map files..." |
|
||||
fn_scriptlog "Copying map files" |
|
||||
sleep 0.5 |
|
||||
find . -name '*.bsp' | cpio --quiet -updm "${fastdldir}" |
|
||||
fn_printok "Map files copied" |
|
||||
sleep 0.5 |
|
||||
echo -en "\n" |
|
||||
|
|
||||
# Materials |
|
||||
fn_printdots "Copying materials..." |
|
||||
fn_scriptlog "Copying materials" |
|
||||
sleep 0.5 |
|
||||
find . -name '*.vtf' | cpio --quiet -updm "${fastdldir}" |
|
||||
find . -name '*.vmt' | cpio --quiet -updm "${fastdldir}" |
|
||||
fn_printok "Materials copied" |
|
||||
sleep 0.5 |
|
||||
echo -en "\n" |
|
||||
|
|
||||
# Models |
|
||||
fn_printdots "Copying models..." |
|
||||
fn_scriptlog "Copying models" |
|
||||
sleep 1 |
|
||||
find . -name '*.vtx' | cpio --quiet -updm "${fastdldir}" |
|
||||
find . -name '*.vvd' | cpio --quiet -updm "${fastdldir}" |
|
||||
find . -name '*.mdl' | cpio --quiet -updm "${fastdldir}" |
|
||||
find . -name '*.phy' | cpio --quiet -updm "${fastdldir}" |
|
||||
fn_printok "Models copied" |
|
||||
sleep 0.5 |
|
||||
echo -en "\n" |
|
||||
|
|
||||
# Particles |
|
||||
fn_printdots "Copying particles..." |
|
||||
fn_scriptlog "Copying particles" |
|
||||
sleep 0.5 |
|
||||
find . -name '*.pcf' | cpio --quiet -updm "${fastdldir}" |
|
||||
fn_printok "Particles copied" |
|
||||
sleep 0.5 |
|
||||
echo -en "\n" |
|
||||
|
|
||||
# Sounds |
|
||||
fn_printdots "Copying sounds..." |
|
||||
fn_scriptlog "Copying sounds" |
|
||||
sleep 0.5 |
|
||||
find . -name '*.wav' | cpio --quiet -updm "${fastdldir}" |
|
||||
find . -name '*.mp3' | cpio --quiet -updm "${fastdldir}" |
|
||||
find . -name '*.ogg' | cpio --quiet -updm "${fastdldir}" |
|
||||
fn_printok "Sounds copied" |
|
||||
sleep 0.5 |
|
||||
echo -en "\n" |
|
||||
|
|
||||
# Resources (mostly fonts) |
|
||||
fn_printdots "Copying fonts and png..." |
|
||||
fn_scriptlog "Copying fonts and png" |
|
||||
sleep 1 |
|
||||
find . -name '*.otf' | cpio --quiet -updm "${fastdldir}" |
|
||||
find . -name '*.ttf' | cpio --quiet -updm "${fastdldir}" |
|
||||
find . -name '*.png' | cpio --quiet -updm "${fastdldir}" |
|
||||
fn_printok "Fonts and png copied" |
|
||||
sleep 0.5 |
|
||||
echo -en "\n" |
|
||||
|
|
||||
# Going back to rootdir in order to prevent mistakes |
|
||||
cd "${rootdir}" |
|
||||
|
|
||||
# Correct addons folder structure for FastDL |
|
||||
if [ -d "${fastdldir}/addons" ]; then |
|
||||
fn_printinfo "Adjusting addons' file structure" |
|
||||
fn_scriptlog "Adjusting addon's file structure" |
|
||||
sleep 1 |
|
||||
cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" |
|
||||
#Don't remove yet rm -R "${fastdldir:?}/addons" |
|
||||
fn_printok "Adjusted addon's file structure" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
fi |
|
||||
|
|
||||
# Correct content that may be into a lua folder by mistake like some darkrpmodification addons |
|
||||
if [ -d "${fastdldir}/lua" ]; then |
|
||||
fn_printdots "Typical DarkRP shit detected, fixing" |
|
||||
sleep 2 |
|
||||
cp -Rf "${fastdldir}/lua/"* "${fastdldir}" |
|
||||
fn_printok "Stupid DarkRP file structure fixed" |
|
||||
sleep 2 |
|
||||
echo -en "\n" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
# Generate lua file that will force download any file into the FastDL folder |
|
||||
fn_lua_fastdl(){ |
|
||||
# Remove lua file if luaressource is turned off and file exists |
|
||||
echo "" |
|
||||
if [ "${luaressource}" == "off" ]; then |
|
||||
if [ -f "${luafastdlfullpath}" ]; then |
|
||||
fn_printdots "Removing download enforcer" |
|
||||
sleep 1 |
|
||||
rm -R "${luafastdlfullpath:?}" |
|
||||
fn_printok "Removed download enforcer" |
|
||||
fn_scriptlog "Removed old download inforcer" |
|
||||
echo -en "\n" |
|
||||
sleep 2 |
|
||||
fi |
|
||||
fi |
|
||||
# Remove old lua file and generate a new one if user said yes |
|
||||
if [ "${luaressource}" == "on" ]; then |
|
||||
if [ -f "${luafastdlfullpath}" ]; then |
|
||||
fn_printdots "Removing old download enforcer" |
|
||||
sleep 1 |
|
||||
rm "${luafastdlfullpath}" |
|
||||
fn_printok "Removed old download enforcer" |
|
||||
fn_scriptlog "Removed old download enforcer" |
|
||||
echo -en "\n" |
|
||||
sleep 1 |
|
||||
fi |
|
||||
fn_printdots "Generating new download enforcer" |
|
||||
fn_scriptlog "Generating new download enforcer" |
|
||||
sleep 1 |
|
||||
# Read all filenames and put them into a lua file at the right path |
|
||||
find "${fastdldir}" \( -type f ! -name "*.bz2" \) -printf '%P\n' | while read line; do |
|
||||
echo "resource.AddFile( "\""${line}"\"" )" >> ${luafastdlfullpath} |
|
||||
done |
|
||||
fn_printok "Download enforcer generated" |
|
||||
fn_scriptlog "Download enforcer generated" |
|
||||
echo -en "\n" |
|
||||
echo "" |
|
||||
sleep 2 |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_fastdl_bzip2(){ |
|
||||
# Compressing using bzip2 if user said yes |
|
||||
echo "" |
|
||||
if [ ${bzip2enable} == "on" ]; then |
|
||||
fn_printinfo "Have a break, this step could take a while..." |
|
||||
echo -en "\n" |
|
||||
echo "" |
|
||||
fn_printdots "Compressing files using bzip2..." |
|
||||
fn_scriptlog "Compressing files using bzip2..." |
|
||||
# bzip2 all files that are not already compressed (keeping original files) |
|
||||
find "${fastdldir}" \( -type f ! -name "*.bz2" \) -exec bzip2 -qk \{\} \; |
|
||||
fn_printok "bzip2 compression done" |
|
||||
fn_scriptlog "bzip2 compression done" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_fastdl_completed(){ |
|
||||
# Finished message |
|
||||
echo "" |
|
||||
fn_printok "Congratulations, it's done !" |
|
||||
fn_scriptlog "FastDL job done" |
|
||||
sleep 2 |
|
||||
echo -en "\n" |
|
||||
echo "" |
|
||||
fn_printinfo "Need more doc ? See https://github.com/dgibbs64/linuxgsm/wiki/FastDL" |
|
||||
echo -en "\n" |
|
||||
if [ "$bzip2installed" == "0" ]; then |
|
||||
echo "By the way, you'd better install bzip2 an re-run this command !" |
|
||||
fi |
|
||||
echo "Credits : UltimateByte" |
|
||||
} |
|
||||
|
|
||||
# Game checking and functions running |
|
||||
# Garry's Mod |
|
||||
if [ "${gamename}" == "Garry's Mod" ]; then |
|
||||
fn_check_bzip2 |
|
||||
fn_fastdl_init |
|
||||
fn_fastdl_config |
|
||||
fn_fastdl_gmod_config |
|
||||
fn_clear_old_fastdl |
|
||||
fn_gmod_fastdl |
|
||||
fn_lua_fastdl |
|
||||
fn_fastdl_bzip2 |
|
||||
fn_fastdl_completed |
|
||||
exit |
|
||||
fi |
|
@ -1,115 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM command_monitor.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
# Description: Monitors server by checking for running proccesses |
|
||||
# then passes to monitor_gsquery.sh. |
|
||||
|
|
||||
local modulename="Monitor" |
|
||||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
||||
|
|
||||
fn_monitor_teamspeak3(){ |
|
||||
check.sh |
|
||||
logs.sh |
|
||||
fn_printdots "${servername}" |
|
||||
fn_scriptlog "${servername}" |
|
||||
sleep 1 |
|
||||
if [ ! -f "${rootdir}/${lockselfname}" ]; then |
|
||||
fn_printinfo "Disabled: No lock file found" |
|
||||
fn_scriptlog "Disabled: No lock file found" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
echo "To enable monitor run ./${selfname} start" |
|
||||
exit 1 |
|
||||
fi |
|
||||
fn_printdots "Checking session: CHECKING" |
|
||||
fn_scriptlog "Checking session: CHECKING" |
|
||||
sleep 1 |
|
||||
info_ts3status.sh |
|
||||
if [ "${ts3status}" = "Server is running" ]; then |
|
||||
fn_printok "Checking session: OK" |
|
||||
fn_scriptlog "Checking session: OK" |
|
||||
sleep 1 |
|
||||
sleep 0.5 |
|
||||
echo -en "\n" |
|
||||
exit |
|
||||
else |
|
||||
fn_printfail "Checking session: FAIL" |
|
||||
fn_scriptlog "Checking session: FAIL" |
|
||||
sleep 1 |
|
||||
fn_printfail "Checking session: FAIL: ${ts3status}" |
|
||||
fn_scriptlog "Checking session: FAIL: ${ts3status}" |
|
||||
failurereason="${ts3status}" |
|
||||
if [ "${emailnotification}" = "on" ]; then |
|
||||
subject="${servicename} Monitor - Restarting ${servername}" |
|
||||
actiontaken="restarted ${servername}" |
|
||||
email.sh |
|
||||
fi |
|
||||
fi |
|
||||
sleep 0.5 |
|
||||
echo -en "\n" |
|
||||
fn_restart |
|
||||
} |
|
||||
|
|
||||
fn_monitor_tmux(){ |
|
||||
check.sh |
|
||||
info_config.sh |
|
||||
fn_printdots "${servername}" |
|
||||
fn_scriptlog "${servername}" |
|
||||
sleep 1 |
|
||||
if [ ! -f "${rootdir}/${lockselfname}" ]; then |
|
||||
fn_printinfo "Disabled: No lock file found" |
|
||||
fn_scriptlog "Disabled: No lock file found" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
echo "To enable monitor run ./${selfname} start" |
|
||||
exit 1 |
|
||||
fi |
|
||||
|
|
||||
updatecheck=$(ps -ef|grep "${selfname} update"|grep -v grep|wc -l) |
|
||||
if [ "${updatecheck}" = "0" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament 2004" ]; then |
|
||||
fn_printdots "Checking session: CHECKING" |
|
||||
fn_scriptlog "Checking session: CHECKING" |
|
||||
sleep 1 |
|
||||
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") |
|
||||
if [ "${tmuxwc}" -eq 1 ]; then |
|
||||
fn_printok "Checking session: OK" |
|
||||
fn_scriptlog "Checking session: OK" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
|
|
||||
if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then |
|
||||
monitor_gsquery.sh |
|
||||
fi |
|
||||
exit $? |
|
||||
else |
|
||||
fn_printfail "Checking session: FAIL" |
|
||||
fn_scriptlog "Checking session: FAIL" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
if [ "${emailnotification}" = "on" ]; then |
|
||||
subject="${servicename} Monitor - Starting ${servername}" |
|
||||
failurereason="${servicename} process not running" |
|
||||
actiontaken="${servicename} has been restarted" |
|
||||
email.sh |
|
||||
fi |
|
||||
fn_scriptlog "Monitor is starting ${servername}" |
|
||||
command_start.sh |
|
||||
fi |
|
||||
else |
|
||||
fn_printinfonl "SteamCMD is currently checking for updates" |
|
||||
fn_scriptlog "SteamCMD is currently checking for updates" |
|
||||
sleep 1 |
|
||||
fn_printinfonl "When update is complete ${servicename} will start" |
|
||||
fn_scriptlog "When update is complete ${servicename} will start" |
|
||||
sleep 1 |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
if [ "${gamename}" == "Teamspeak 3" ]; then |
|
||||
fn_monitor_teamspeak3 |
|
||||
else |
|
||||
fn_monitor_tmux |
|
||||
fi |
|
@ -1,194 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM command_start.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="070116" |
|
||||
|
|
||||
# Description: Starts the server. |
|
||||
|
|
||||
local modulename="Starting" |
|
||||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
||||
|
|
||||
fn_start_teamspeak3(){ |
|
||||
check.sh |
|
||||
info_ts3status.sh |
|
||||
|
|
||||
if [ "${ts3status}" != "Server is running" ]; then |
|
||||
# Will check for updates is updateonstart is yes |
|
||||
if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then |
|
||||
update_check.sh |
|
||||
fi |
|
||||
fi |
|
||||
|
|
||||
if [ ! -e "${servercfgfullpath}" ]; then |
|
||||
fn_printwarn "${servercfgfullpath} is missing" |
|
||||
fn_scriptlog "${servercfgfullpath} is missing" |
|
||||
sleep 2 |
|
||||
echo -en "\n" |
|
||||
echo " * Creating blank ${servercfg}" |
|
||||
fn_scriptlog "Creating blank ${servercfg}" |
|
||||
sleep 2 |
|
||||
echo " * ${servercfg} can remain blank by default." |
|
||||
fn_scriptlog "${servercfgfullpath} can remain blank by default." |
|
||||
sleep 2 |
|
||||
echo " * ${servercfg} is located in ${servercfgfullpath}." |
|
||||
fn_scriptlog "${servercfg} is located in ${servercfgfullpath}." |
|
||||
sleep 5 |
|
||||
touch "${servercfgfullpath}" |
|
||||
fi |
|
||||
|
|
||||
logs.sh |
|
||||
|
|
||||
fn_printdots "${servername}" |
|
||||
fn_scriptlog "${servername}" |
|
||||
sleep 1 |
|
||||
|
|
||||
if [ "${ts3status}" == "Server is running" ]; then |
|
||||
fn_printinfo "${servername} is already running" |
|
||||
fn_scriptlog "${servername} is already running" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
exit |
|
||||
fi |
|
||||
|
|
||||
mv "${scriptlog}" "${scriptlogdate}" |
|
||||
# Create lock file |
|
||||
date > "${rootdir}/${lockselfname}" |
|
||||
cd "${executabledir}" |
|
||||
if [ "${ts3serverpass}" == "1" ];then |
|
||||
./ts3server_startscript.sh start serveradmin_password="${newpassword}" inifile="${servercfgfullpath}" |
|
||||
else |
|
||||
./ts3server_startscript.sh start inifile="${servercfgfullpath}" > /dev/null 2>&1 |
|
||||
fi |
|
||||
sleep 1 |
|
||||
info_ts3status.sh |
|
||||
if [ "${ts3status}" = "Server seems to have died" ]||[ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then |
|
||||
fn_printfailnl "Unable to start ${servername}" |
|
||||
fn_scriptlog "Unable to start ${servername}" |
|
||||
echo -e " Check log files: ${rootdir}/log" |
|
||||
exit 1 |
|
||||
else |
|
||||
fn_printok "${servername}" |
|
||||
fn_scriptlog "Started ${servername}" |
|
||||
fi |
|
||||
sleep 0.5 |
|
||||
echo -en "\n" |
|
||||
} |
|
||||
|
|
||||
fn_start_tmux(){ |
|
||||
check.sh |
|
||||
fix.sh |
|
||||
info_config.sh |
|
||||
fn_parms |
|
||||
logs.sh |
|
||||
|
|
||||
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") |
|
||||
# Will check for updates if updateonstart is yes |
|
||||
if [ "${tmuxwc}" -eq 0 ]; then |
|
||||
if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then |
|
||||
update_check.sh |
|
||||
fi |
|
||||
fi |
|
||||
|
|
||||
fn_printdots "${servername}" |
|
||||
fn_scriptlog "${servername}" |
|
||||
sleep 1 |
|
||||
|
|
||||
if [ "${tmuxwc}" -eq 0 ]; then |
|
||||
fn_scriptlog "Rotating log files" |
|
||||
if [ "${engine}" == "unreal2" ]; then |
|
||||
mv "${gamelog}" "${gamelogdate}" |
|
||||
fi |
|
||||
mv "${scriptlog}" "${scriptlogdate}" |
|
||||
mv "${consolelog}" "${consolelogdate}" |
|
||||
fi |
|
||||
|
|
||||
if [ "${tmuxwc}" -eq 1 ]; then |
|
||||
fn_printinfo "${servername} is already running" |
|
||||
fn_scriptlog "${servername} is already running" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
exit |
|
||||
fi |
|
||||
|
|
||||
# Create lock file |
|
||||
date > "${rootdir}/${lockselfname}" |
|
||||
cd "${executabledir}" |
|
||||
tmux new-session -d -s "${servicename}" "${executable} ${parms}" 2> "${scriptlogdir}/.${servicename}-tmux-error.tmp" |
|
||||
# tmux pipe-pane not supported in tmux versions < 1.6 |
|
||||
if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ]; then |
|
||||
echo "Console logging disabled: Tmux => 1.6 required" >> "${consolelog}" |
|
||||
echo "http://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" |
|
||||
echo "Currently installed: $(tmux -V)" >> "${consolelog}" |
|
||||
elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -eq "18" ]; then |
|
||||
echo "Console logging disabled: Bug in tmux 1.8 breaks logging" >> "${consolelog}" |
|
||||
echo "http://gameservermanagers.com/tmux-upgrade" >> "${consolelog}" |
|
||||
echo "Currently installed: $(tmux -V)" >> "${consolelog}" |
|
||||
else |
|
||||
touch "${consolelog}" |
|
||||
tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'" |
|
||||
fi |
|
||||
sleep 1 |
|
||||
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") |
|
||||
# If the server fails to start |
|
||||
if [ "${tmuxwc}" -eq 0 ]; then |
|
||||
fn_printfailnl "Unable to start ${servername}" |
|
||||
fn_scriptlog "Unable to start ${servername}" |
|
||||
sleep 1 |
|
||||
if [ -s "${scriptlogdir}/.${servicename}-tmux-error.tmp" ]; then |
|
||||
fn_printfailnl "Unable to start ${servername}: Tmux error:" |
|
||||
fn_scriptlog "Tmux error" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
echo "" |
|
||||
echo "Command" |
|
||||
echo "=================================" |
|
||||
echo "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\"" |
|
||||
echo "tmux new-session -d -s \"${servicename}\" \"${executable} ${parms}\"" >> "${scriptlog}" |
|
||||
echo "" |
|
||||
echo "Error" |
|
||||
echo "=================================" |
|
||||
cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" |
|
||||
cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" >> "${scriptlog}" |
|
||||
|
|
||||
# Detected error http://gameservermanagers.com/issues |
|
||||
if [ $(grep -c "Operation not permitted" "${scriptlogdir}/.${servicename}-tmux-error.tmp") ]; then |
|
||||
echo "" |
|
||||
echo "Fix" |
|
||||
echo "=================================" |
|
||||
if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ]; then |
|
||||
echo "$(whoami) is not part of the tty group." |
|
||||
fn_scriptlog "$(whoami) is not part of the tty group." |
|
||||
group=$(grep tty /etc/group) |
|
||||
echo "" |
|
||||
echo " ${group}" |
|
||||
fn_scriptlog "${group}" |
|
||||
echo "" |
|
||||
echo "Run the following command with root privileges." |
|
||||
echo "" |
|
||||
echo " usermod -G tty $(whoami)" |
|
||||
echo "" |
|
||||
echo "http://gameservermanagers.com/tmux-op-perm" |
|
||||
fn_scriptlog "http://gameservermanagers.com/tmux-op-perm" |
|
||||
else |
|
||||
echo "No known fix currently. Please log an issue." |
|
||||
fn_scriptlog "No known fix currently. Please log an issue." |
|
||||
echo "http://gameservermanagers.com/issues" |
|
||||
fn_scriptlog "http://gameservermanagers.com/issues" |
|
||||
fi |
|
||||
fi |
|
||||
fi |
|
||||
exit 1 |
|
||||
else |
|
||||
fn_printok "${servername}" |
|
||||
fn_scriptlog "Started ${servername}" |
|
||||
fi |
|
||||
rm "${scriptlogdir}/.${servicename}-tmux-error.tmp" |
|
||||
echo -en "\n" |
|
||||
} |
|
||||
|
|
||||
if [ "${gamename}" == "Teamspeak 3" ]; then |
|
||||
fn_start_teamspeak3 |
|
||||
else |
|
||||
fn_start_tmux |
|
||||
fi |
|
@ -1,159 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM command_stop.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
# Description: Stops the server. |
|
||||
|
|
||||
local modulename="Stopping" |
|
||||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
||||
|
|
||||
sdtd_telnet(){ |
|
||||
sdtdshutdown=$( expect -c ' |
|
||||
proc abort {} { |
|
||||
puts "Timeout or EOF\n" |
|
||||
exit 1 |
|
||||
} |
|
||||
spawn telnet '"${telnetip}"' '"${telnetport}"' |
|
||||
expect { |
|
||||
"password:" { send "'"${telnetpass}"'\r" } |
|
||||
default abort |
|
||||
} |
|
||||
expect { |
|
||||
"session." { send "shutdown\r" } |
|
||||
default abort |
|
||||
} |
|
||||
expect { eof } |
|
||||
puts "Completed.\n" |
|
||||
') |
|
||||
} |
|
||||
|
|
||||
fn_stop_teamspeak3(){ |
|
||||
check.sh |
|
||||
fn_printdots "${servername}" |
|
||||
fn_scriptlog "${servername}" |
|
||||
sleep 1 |
|
||||
info_ts3status.sh |
|
||||
if [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then |
|
||||
fn_printfail "${servername} is already stopped" |
|
||||
fn_scriptlog "${servername} is already stopped" |
|
||||
else |
|
||||
${filesdir}/ts3server_startscript.sh stop > /dev/null 2>&1 |
|
||||
fn_printok "${servername}" |
|
||||
fn_scriptlog "Stopped ${servername}" |
|
||||
fi |
|
||||
# Remove lock file |
|
||||
rm -f "${rootdir}/${lockselfname}" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
} |
|
||||
|
|
||||
fn_stop_tmux(){ |
|
||||
check.sh |
|
||||
info_config.sh |
|
||||
fn_printdots "${servername}" |
|
||||
fn_scriptlog "${servername}" |
|
||||
sleep 1 |
|
||||
|
|
||||
if [ "${gamename}" == "7 Days To Die" ] ; then |
|
||||
# if game is 7 Days To Die, we need special, graceful shutdown via telnet connection. |
|
||||
# Set below variable to be called for expect to operate correctly.. |
|
||||
fn_printdots "Attempting graceful shutdown via telnet" |
|
||||
fn_scriptlog "Attempting graceful shutdown via telnet" |
|
||||
sleep 1 |
|
||||
telnetip=127.0.0.1 |
|
||||
sdtd_telnet |
|
||||
|
|
||||
# If failed using localhost will use servers ip |
|
||||
refused=$(echo -en "\n ${sdtdshutdown}"| grep "Timeout or EOF") |
|
||||
if [ -n "${refused}" ]; then |
|
||||
telnetip=${ip} |
|
||||
fn_printwarn "Attempting graceful shutdown via telnet: localhost failed" |
|
||||
fn_scriptlog "Warning! Attempting graceful shutdown failed using localhost" |
|
||||
sleep 5 |
|
||||
echo -en "\n" |
|
||||
fn_printdots "Attempting graceful shutdown via telnet: using ${telnetip}" |
|
||||
fn_scriptlog "Attempting graceful shutdown via telnet using ${telnetip}" |
|
||||
sdtd_telnet |
|
||||
sleep 1 |
|
||||
fi |
|
||||
|
|
||||
refused=$(echo -en "\n ${sdtdshutdown}"| grep "Timeout or EOF") |
|
||||
completed=$(echo -en "\n ${sdtdshutdown}"| grep "Completed.") |
|
||||
if [ -n "${refused}" ]; then |
|
||||
fn_printfail "Attempting graceful shutdown via telnet" |
|
||||
fn_scriptlog "Attempting graceful shutdown failed" |
|
||||
fn_scriptlog "${refused}" |
|
||||
elif [ -n "${completed}" ]; then |
|
||||
fn_printok "Attempting graceful shutdown via telnet" |
|
||||
fn_scriptlog "Attempting graceful shutdown succeeded" |
|
||||
else |
|
||||
fn_printfail "Attempting graceful shutdown via telnet: Unknown error" |
|
||||
fn_scriptlog "Attempting graceful shutdown failed" |
|
||||
fn_scriptlog "Unknown error" |
|
||||
fi |
|
||||
sleep 1 |
|
||||
echo -en "\n\n" |
|
||||
echo -en "Telnet output:" |
|
||||
echo -en "\n ${sdtdshutdown}" |
|
||||
echo -en "\n\n" |
|
||||
sleep 1 |
|
||||
fn_printdots "${servername}" |
|
||||
fn_scriptlog "${servername}" |
|
||||
sleep 5 |
|
||||
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") |
|
||||
if [ "${pid}" == "0" ]; then |
|
||||
fn_printok "${servername} is already stopped using graceful shutdown" |
|
||||
fn_scriptlog "${servername} is already stopped using graceful shutdown" |
|
||||
else |
|
||||
tmux kill-session -t "${servicename}" |
|
||||
fn_printok "${servername}" |
|
||||
fn_scriptlog "Stopped ${servername}" |
|
||||
fi |
|
||||
|
|
||||
else |
|
||||
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") |
|
||||
if [ "${pid}" == "0" ]; then |
|
||||
fn_printfail "${servername} is already stopped" |
|
||||
fn_scriptlog "${servername} is already stopped" |
|
||||
else |
|
||||
|
|
||||
if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then |
|
||||
sleep 1 |
|
||||
fn_printdots "Attempting graceful shutdown" |
|
||||
fn_scriptlog "Attempting graceful shutdown" |
|
||||
tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1 |
|
||||
counter=0 |
|
||||
while [ "${pid}" != "0" -a $counter -lt 30 ]; do |
|
||||
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") |
|
||||
sleep 1 |
|
||||
let counter=counter+1 |
|
||||
if [ "${counter}" -gt "1" ]; then |
|
||||
fn_printdots "Attempting graceful shutdown: ${counter}" |
|
||||
fi |
|
||||
done |
|
||||
pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:") |
|
||||
if [ "${pid}" == "0" ]; then |
|
||||
fn_printok "Attempting graceful shutdown" |
|
||||
else |
|
||||
fn_printfail "Attempting graceful shutdown" |
|
||||
fi |
|
||||
fi |
|
||||
|
|
||||
tmux kill-session -t "${servicename}" > /dev/null 2>&1 |
|
||||
fn_printok "${servername}" |
|
||||
fn_scriptlog "Stopped ${servername}" |
|
||||
fi |
|
||||
fi |
|
||||
# Remove lock file |
|
||||
rm -f "${rootdir}/${lockselfname}" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
} |
|
||||
|
|
||||
if [ "${gamename}" == "Teamspeak 3" ]; then |
|
||||
fn_stop_teamspeak3 |
|
||||
else |
|
||||
fn_stop_tmux |
|
||||
fi |
|
@ -1,63 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM command_serveradmin_password.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Contributor : UltimateByte |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="080116" |
|
||||
|
|
||||
# Description: Changes TS3 serveradmin password |
|
||||
|
|
||||
local modulename="Change password" |
|
||||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
||||
|
|
||||
|
|
||||
fn_serveradmin_password_prompt(){ |
|
||||
echo "" |
|
||||
echo "${gamename} ServerAdmin Password Change" |
|
||||
echo "============================" |
|
||||
echo "" |
|
||||
echo "Press \"CTRL+b d\" to exit console." |
|
||||
fn_printinfomationnl "You are about to change the ${gamename} ServerAdmin password." |
|
||||
fn_printwarningnl "${gamename} will restart during this process." |
|
||||
echo "" |
|
||||
while true; do |
|
||||
read -e -i "y" -p "Continue? [y/N]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) break;; |
|
||||
[Nn]* ) echo Exiting; exit;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
fn_scriptlog "Initiating ${gamename} ServerAdmin password change" |
|
||||
read -p "Enter new password : " newpassword |
|
||||
} |
|
||||
|
|
||||
|
|
||||
fn_serveradmin_password_set(){ |
|
||||
fn_printinfonl "Applying new password" |
|
||||
fn_scriptlog "Applying new password" |
|
||||
sleep 1 |
|
||||
# Stop any running server |
|
||||
command_stop.sh |
|
||||
# Start server in "new password mode" |
|
||||
ts3serverpass="1" |
|
||||
fn_printinfonl "Starting server with new password" |
|
||||
command_start.sh |
|
||||
# Stop server in "new password mode" |
|
||||
command_stop.sh |
|
||||
ts3serverpass="0" |
|
||||
fn_printoknl "Password applied" |
|
||||
fn_scriptlog "New ServerAdmin password applied" |
|
||||
sleep 1 |
|
||||
} |
|
||||
|
|
||||
# Running functions |
|
||||
check.sh |
|
||||
fn_serveradmin_password_prompt |
|
||||
info_ts3status.sh |
|
||||
if [ "${ts3status}" == "Server is running" ]; then |
|
||||
fn_serveradmin_password_set |
|
||||
command_start.sh |
|
||||
else |
|
||||
fn_serveradmin_password_set |
|
||||
fi |
|
@ -0,0 +1,38 @@ |
|||||
|
#!/bin/bash |
||||
|
# LGSM command_update_functions.sh function |
||||
|
# Author: Daniel Gibbs |
||||
|
# Website: https://gameservermanagers.com |
||||
|
lgsm_version="210516" |
||||
|
|
||||
|
# Description: Deletes the functions dir to allow re-downloading of functions from GitHub. |
||||
|
|
||||
|
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
|
check.sh |
||||
|
fn_print_dots "Updating functions" |
||||
|
fn_scriptlog "Updating functions" |
||||
|
sleep 1 |
||||
|
echo -ne "\n" |
||||
|
|
||||
|
# Removed legecy functions dir |
||||
|
if [ -n "${rootdir}" ]; then |
||||
|
if [ -d "${rootdir}/functions/" ]; then |
||||
|
rm -rfv "${rootdir}/functions/" |
||||
|
exitcode=$? |
||||
|
fi |
||||
|
fi |
||||
|
|
||||
|
if [ -n "${functionsdir}" ]; then |
||||
|
if [ -d "${functionsdir}" ]; then |
||||
|
rm -rfv "${functionsdir}/"* |
||||
|
exitcode=$? |
||||
|
fi |
||||
|
fi |
||||
|
|
||||
|
if [ "${exitcode}" == "0" ]; then |
||||
|
fn_print_ok "Updating functions" |
||||
|
fn_scriptlog "Success! Updating functions" |
||||
|
else |
||||
|
fn_print_fail "Updating functions" |
||||
|
fn_scriptlog "Failure! Updating functions" |
||||
|
fi |
||||
|
echo -ne "\n" |
@ -1,49 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM command_validate.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
# Description: Runs a server validation. |
|
||||
|
|
||||
local modulename="Validate" |
|
||||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
||||
|
|
||||
fn_validation(){ |
|
||||
fn_printwarn "Validating may overwrite some customised files." |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
echo -en "https://developer.valvesoftware.com/wiki/SteamCMD#Validate" |
|
||||
sleep 5 |
|
||||
echo -en "\n" |
|
||||
fn_printdots "Checking server files" |
|
||||
sleep 1 |
|
||||
fn_printok "Checking server files" |
|
||||
fn_scriptlog "Checking server files" |
|
||||
sleep 1 |
|
||||
|
|
||||
cd "${rootdir}/steamcmd" |
|
||||
|
|
||||
if [ $(command -v unbuffer) ]; then |
|
||||
unbuffer=unbuffer |
|
||||
fi |
|
||||
|
|
||||
if [ "${engine}" == "goldsource" ]; then |
|
||||
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}" |
|
||||
else |
|
||||
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}" |
|
||||
fi |
|
||||
|
|
||||
fix.sh |
|
||||
fn_scriptlog "Checking complete" |
|
||||
} |
|
||||
|
|
||||
check.sh |
|
||||
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") |
|
||||
if [ "${tmuxwc}" -eq 1 ]; then |
|
||||
command_stop.sh |
|
||||
fn_validation |
|
||||
command_start.sh |
|
||||
else |
|
||||
fn_validation |
|
||||
fi |
|
@ -1,407 +1,63 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
# LGSM core_functions.sh function |
# LGSM core_functions.sh function |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
lgsm_version="190216" |
lgsm_version="210516" |
||||
|
|
||||
# Description: Defines all functions to allow download and execution of functions using fn_runfunction. |
# Description: REDIRECT FUNCTION to new location for core_functions.sh |
||||
# This function is called first before any other function. Without this file other functions would not load. |
|
||||
|
# fn_fetch_core_dl also placed here to allow legecy servers to still download core functions |
||||
#Legacy functions |
if [ -z "${lgsmdir}" ]; then |
||||
|
lgsmdir="${rootdir}/lgsm" |
||||
fn_functions(){ |
functionsdir="${lgsmdir}/functions" |
||||
functionfile="${FUNCNAME}" |
libdir="${lgsmdir}/lib" |
||||
fn_runfunction |
fi |
||||
} |
|
||||
|
fn_fetch_core_dl(){ |
||||
fn_getopt(){ |
github_file_url_dir="lgsm/functions" |
||||
functionfile="${FUNCNAME}" |
github_file_url_name="${functionfile}" |
||||
fn_runfunction |
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 |
||||
# Core |
if [ ! -f "${filedir}/${filename}" ]; then |
||||
|
if [ ! -d "${filedir}" ]; then |
||||
core_getopt.sh(){ |
mkdir -p "${filedir}" |
||||
functionfile="${FUNCNAME}" |
fi |
||||
fn_runfunction |
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)" |
||||
core_messages.sh(){ |
for curlcmd in ${curlpaths} |
||||
functionfile="${FUNCNAME}" |
do |
||||
fn_runfunction |
if [ -x "${curlcmd}" ]; then |
||||
} |
break |
||||
|
fi |
||||
|
done |
||||
# Command |
# If curl exists download file |
||||
|
if [ "$(basename ${curlcmd})" == "curl" ]; then |
||||
command_console.sh(){ |
curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1) |
||||
functionfile="${FUNCNAME}" |
if [ $? -ne 0 ]; then |
||||
fn_runfunction |
echo -e "\e[0;31mFAIL\e[0m\n" |
||||
} |
echo "${curlfetch}" |
||||
|
echo -e "${githuburl}\n" |
||||
command_debug.sh(){ |
exit 1 |
||||
functionfile="${FUNCNAME}" |
else |
||||
fn_runfunction |
echo -e "\e[0;32mOK\e[0m" |
||||
} |
fi |
||||
|
else |
||||
command_details.sh(){ |
echo -e "\e[0;31mFAIL\e[0m\n" |
||||
functionfile="${FUNCNAME}" |
echo "Curl is not installed!" |
||||
fn_runfunction |
echo -e "" |
||||
} |
exit 1 |
||||
|
fi |
||||
command_email_test.sh(){ |
chmod +x "${filedir}/${filename}" |
||||
functionfile="${FUNCNAME}" |
fi |
||||
fn_runfunction |
source "${filedir}/${filename}" |
||||
} |
} |
||||
|
|
||||
command_backup.sh(){ |
core_functions.sh(){ |
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
command_monitor.sh(){ |
core_functions.sh |
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
command_start.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
command_stop.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
command_validate.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
command_install.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
command_fastdl.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
command_ts3_server_pass.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
fn_restart(){ |
|
||||
local modulename="Restarting" |
|
||||
info_config.sh |
|
||||
fn_scriptlog "${servername}" |
|
||||
command_stop.sh |
|
||||
command_start.sh |
|
||||
} |
|
||||
|
|
||||
|
|
||||
# Checks |
|
||||
|
|
||||
check.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
check_config.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
check_deps.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
check_ip.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
check_logs.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
check_root.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
check_steamcmd.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
check_steamuser.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
check_systemdir.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
check_tmux.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
|
|
||||
# Compress |
|
||||
|
|
||||
compress_unreal2_maps.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
compress_ut99_maps.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
|
|
||||
# Dev |
|
||||
|
|
||||
command_dev_debug.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
command_dev_detect_deps.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
|
|
||||
# Fix |
|
||||
|
|
||||
fix.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
fix_arma3.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
fix_csgo.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
fix_dst.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
fix_ins.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
fix_steamcmd.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
fix_glibc.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
fix_ro.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
fix_kf.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
fix_ut2k4.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
|
|
||||
# Info |
|
||||
|
|
||||
info_config.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
info_distro.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
info_glibc.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
info_ts3status.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
|
|
||||
# Email |
|
||||
|
|
||||
email.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
# Logs |
|
||||
|
|
||||
logs.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
|
|
||||
# Monitor |
|
||||
|
|
||||
monitor_gsquery.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
|
|
||||
# Update |
|
||||
|
|
||||
update_check.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
update_functions.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
update_dl.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
update_functions.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
|
|
||||
# |
|
||||
## Installer functions |
|
||||
# |
|
||||
|
|
||||
fn_autoinstall(){ |
|
||||
autoinstall=1 |
|
||||
command_install.sh |
|
||||
} |
|
||||
|
|
||||
install_complete.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_config.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_gsquery.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_gslt.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_header.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_logs.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_retry.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_serverdir.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
install_serverfiles.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_steamcmd.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_ts3.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_ts3db.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_ut2k4.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_dl_ut2k4.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_ut2k4_key.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_ut99.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
install_dl_ut99.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
fix_ut99.sh(){ |
|
||||
functionfile="${FUNCNAME}" |
|
||||
fn_runfunction |
|
||||
} |
|
||||
|
|
||||
# Calls on-screen messages |
|
||||
core_messages.sh |
|
@ -1,432 +1,14 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
# LGSM core_getopt.sh function |
# LGSM core_getopt.sh function |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
lgsm_version="070116" |
lgsm_version="210516" |
||||
|
|
||||
# Description: getopt arguments. |
# Description: REDIRECT FUNCTION to new location for core_getopt.sh |
||||
|
|
||||
fn_getopt_generic(){ |
core_getopt.sh(){ |
||||
case "$getopt" in |
functionfile="${FUNCNAME}" |
||||
st|start) |
fn_fetch_core_dl |
||||
command_start.sh;; |
|
||||
sp|stop) |
|
||||
command_stop.sh;; |
|
||||
r|restart) |
|
||||
fn_restart;; |
|
||||
u|update) |
|
||||
update_check.sh;; |
|
||||
fu|force-update|update-restart) |
|
||||
forceupdate=1; |
|
||||
update_check.sh;; |
|
||||
uf|update-functions) |
|
||||
update_functions.sh;; |
|
||||
v|validate) |
|
||||
command_validate.sh;; |
|
||||
m|monitor) |
|
||||
command_monitor.sh;; |
|
||||
et|email-test) |
|
||||
command_email_test.sh;; |
|
||||
d|details) |
|
||||
command_details.sh;; |
|
||||
b|backup) |
|
||||
command_backup.sh;; |
|
||||
c|console) |
|
||||
command_console.sh;; |
|
||||
d|debug) |
|
||||
command_debug.sh;; |
|
||||
dev|dev-debug) |
|
||||
command_dev_debug.sh;; |
|
||||
i|install) |
|
||||
command_install.sh;; |
|
||||
ai|auto-install) |
|
||||
fn_autoinstall;; |
|
||||
dd|depsdetect) |
|
||||
command_dev_detect_deps.sh;; |
|
||||
*) |
|
||||
echo "Usage: $0 [option]" |
|
||||
echo "${gamename} - Linux Game Server Manager - Version ${version}" |
|
||||
echo "http://gameservermanagers.com/${selfname}" |
|
||||
echo -e "" |
|
||||
echo -e "\e[93mCommands\e[0m" |
|
||||
{ |
|
||||
echo -e "\e[34mstart\t\e[0mStart the server." |
|
||||
echo -e "\e[34mstop\t\e[0mStop the server." |
|
||||
echo -e "\e[34mrestart\t\e[0mRestart the server." |
|
||||
echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD." |
|
||||
echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD." |
|
||||
echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." |
|
||||
echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD." |
|
||||
echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." |
|
||||
echo -e "\e[34memail-test\t\e[0mSends test monitor email." |
|
||||
echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." |
|
||||
echo -e "\e[34mbackup\t\e[0mCreate archive of the server." |
|
||||
echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." |
|
||||
echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." |
|
||||
echo -e "\e[34minstall\t\e[0mInstall the server." |
|
||||
echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." |
|
||||
} | column -s $'\t' -t |
|
||||
esac |
|
||||
exit |
|
||||
} |
} |
||||
|
|
||||
fn_getopt_teamspeak3(){ |
core_getopt.sh |
||||
case "$getopt" in |
|
||||
st|start) |
|
||||
command_start.sh;; |
|
||||
sp|stop) |
|
||||
command_stop.sh;; |
|
||||
r|restart) |
|
||||
fn_restart;; |
|
||||
u|update) |
|
||||
update_check.sh;; |
|
||||
uf|update-functions) |
|
||||
update_functions.sh;; |
|
||||
m|monitor) |
|
||||
command_monitor.sh;; |
|
||||
et|email-test) |
|
||||
command_email_test.sh;; |
|
||||
d|details) |
|
||||
command_details.sh;; |
|
||||
b|backup) |
|
||||
command_backup.sh;; |
|
||||
pw|change-password) |
|
||||
command_ts3_server_pass.sh;; |
|
||||
dev|dev-debug) |
|
||||
command_dev_debug.sh;; |
|
||||
i|install) |
|
||||
command_install.sh;; |
|
||||
ai|auto-install) |
|
||||
fn_autoinstall;; |
|
||||
dd|depsdetect) |
|
||||
command_dev_detect_deps.sh;; |
|
||||
*) |
|
||||
echo "Usage: $0 [option]" |
|
||||
echo "${gamename} - Linux Game Server Manager - Version ${version}" |
|
||||
echo "http://gameservermanagers.com/${selfname}" |
|
||||
echo -e "" |
|
||||
echo -e "\e[93mCommands\e[0m" |
|
||||
{ |
|
||||
echo -e "\e[34mstart\t\e[0mStart the server." |
|
||||
echo -e "\e[34mstop\t\e[0mStop the server." |
|
||||
echo -e "\e[34mrestart\t\e[0mRestart the server." |
|
||||
echo -e "\e[34mupdate\t\e[0mChecks and applies updates from teamspeak.com." |
|
||||
echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." |
|
||||
echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." |
|
||||
echo -e "\e[34memail-test\t\e[0mSends test monitor email." |
|
||||
echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." |
|
||||
echo -e "\e[34mchange-password\t\e[0mChanges TS3 serveradmin password." |
|
||||
echo -e "\e[34mbackup\t\e[0mCreate archive of the server." |
|
||||
echo -e "\e[34minstall\t\e[0mInstall the server." |
|
||||
echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." |
|
||||
} | column -s $'\t' -t |
|
||||
esac |
|
||||
exit |
|
||||
} |
|
||||
|
|
||||
fn_getopt_mumble(){ |
|
||||
case "$getopt" in |
|
||||
st|start) |
|
||||
command_start.sh;; |
|
||||
sp|stop) |
|
||||
command_stop.sh;; |
|
||||
r|restart) |
|
||||
fn_restart;; |
|
||||
uf|update-functions) |
|
||||
update_functions.sh;; |
|
||||
m|monitor) |
|
||||
command_monitor.sh;; |
|
||||
et|email-test) |
|
||||
command_email_test.sh;; |
|
||||
b|backup) |
|
||||
command_backup.sh;; |
|
||||
dev|dev-debug) |
|
||||
command_dev_debug.sh;; |
|
||||
console) |
|
||||
command_console.sh;; |
|
||||
d|debug) |
|
||||
command_debug.sh;; |
|
||||
dd|depsdetect) |
|
||||
command_dev_detect_deps.sh;; |
|
||||
*) |
|
||||
echo "Usage: $0 [option]" |
|
||||
echo "${gamename} - Linux Game Server Manager - Version ${version}" |
|
||||
echo "http://gameservermanagers.com/${selfname}" |
|
||||
echo -e "" |
|
||||
echo -e "\e[93mCommands\e[0m" |
|
||||
{ |
|
||||
echo -e "\e[34mstart\t\e[0mStart the server." |
|
||||
echo -e "\e[34mstop\t\e[0mStop the server." |
|
||||
echo -e "\e[34mrestart\t\e[0mRestart the server." |
|
||||
echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." |
|
||||
echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." |
|
||||
echo -e "\e[34memail-test\t\e[0mSends test monitor email." |
|
||||
echo -e "\e[34mbackup\t\e[0mCreate archive of the server." |
|
||||
echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." |
|
||||
echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." |
|
||||
} | column -s $'\t' -t |
|
||||
esac |
|
||||
exit |
|
||||
} |
|
||||
|
|
||||
fn_getopt_gmodserver(){ |
|
||||
case "$getopt" in |
|
||||
st|start) |
|
||||
command_start.sh;; |
|
||||
sp|stop) |
|
||||
command_stop.sh;; |
|
||||
r|restart) |
|
||||
fn_restart;; |
|
||||
u|update) |
|
||||
update_check.sh;; |
|
||||
fu|force-update|update-restart) |
|
||||
forceupdate=1; |
|
||||
update_check.sh;; |
|
||||
uf|update-functions) |
|
||||
update_functions.sh;; |
|
||||
v|validate) |
|
||||
command_validate.sh;; |
|
||||
m|monitor) |
|
||||
command_monitor.sh;; |
|
||||
et|email-test) |
|
||||
command_email_test.sh;; |
|
||||
d|details) |
|
||||
command_details.sh;; |
|
||||
b|backup) |
|
||||
command_backup.sh;; |
|
||||
c|console) |
|
||||
command_console.sh;; |
|
||||
d|debug) |
|
||||
command_debug.sh;; |
|
||||
dev|dev-debug) |
|
||||
command_dev_debug.sh;; |
|
||||
i|install) |
|
||||
command_install.sh;; |
|
||||
ai|auto-install) |
|
||||
fn_autoinstall;; |
|
||||
dd|depsdetect) |
|
||||
command_dev_detect_deps.sh;; |
|
||||
fd|fastdl) |
|
||||
command_fastdl.sh;; |
|
||||
*) |
|
||||
echo "Usage: $0 [option]" |
|
||||
echo "${gamename} - Linux Game Server Manager - Version ${version}" |
|
||||
echo "http://gameservermanagers.com/${selfname}" |
|
||||
echo -e "" |
|
||||
echo -e "\e[93mCommands\e[0m" |
|
||||
{ |
|
||||
echo -e "\e[34mstart\t\e[0mStart the server." |
|
||||
echo -e "\e[34mstop\t\e[0mStop the server." |
|
||||
echo -e "\e[34mrestart\t\e[0mRestart the server." |
|
||||
echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD." |
|
||||
echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD." |
|
||||
echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." |
|
||||
echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD." |
|
||||
echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." |
|
||||
echo -e "\e[34memail-test\t\e[0mSends test monitor email." |
|
||||
echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." |
|
||||
echo -e "\e[34mbackup\t\e[0mCreate archive of the server." |
|
||||
echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." |
|
||||
echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." |
|
||||
echo -e "\e[34minstall\t\e[0mInstall the server." |
|
||||
echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." |
|
||||
echo -e "\e[34mfastdl\t\e[0mGenerates or update a FastDL folder for your server." |
|
||||
} | column -s $'\t' -t |
|
||||
esac |
|
||||
exit |
|
||||
} |
|
||||
|
|
||||
fn_getopt_unreal(){ |
|
||||
case "$getopt" in |
|
||||
st|start) |
|
||||
command_start.sh;; |
|
||||
sp|stop) |
|
||||
command_stop.sh;; |
|
||||
r|restart) |
|
||||
fn_restart;; |
|
||||
uf|update-functions) |
|
||||
update_functions.sh;; |
|
||||
m|monitor) |
|
||||
command_monitor.sh;; |
|
||||
et|email-test) |
|
||||
command_email_test.sh;; |
|
||||
d|details) |
|
||||
command_details.sh;; |
|
||||
b|backup) |
|
||||
command_backup.sh;; |
|
||||
c|console) |
|
||||
command_console.sh;; |
|
||||
d|debug) |
|
||||
command_debug.sh;; |
|
||||
dev|dev-debug) |
|
||||
command_dev_debug.sh;; |
|
||||
i|install) |
|
||||
command_install.sh;; |
|
||||
mc|map-compressor) |
|
||||
compress_ut99_maps.sh;; |
|
||||
dd|depsdetect) |
|
||||
command_dev_detect_deps.sh;; |
|
||||
*) |
|
||||
echo "Usage: $0 [option]" |
|
||||
echo "${gamename} - Linux Game Server Manager - Version ${version}" |
|
||||
echo "http://gameservermanagers.com/${selfname}" |
|
||||
echo -e "" |
|
||||
echo -e "\e[93mCommands\e[0m" |
|
||||
{ |
|
||||
echo -e "\e[34mstart\t\e[0mStart the server." |
|
||||
echo -e "\e[34mstop\t\e[0mStop the server." |
|
||||
echo -e "\e[34mrestart\t\e[0mRestart the server." |
|
||||
echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." |
|
||||
echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." |
|
||||
echo -e "\e[34memail-test\t\e[0mSends test monitor email." |
|
||||
echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." |
|
||||
echo -e "\e[34mbackup\t\e[0mCreate archive of the server." |
|
||||
echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." |
|
||||
echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." |
|
||||
echo -e "\e[34minstall\t\e[0mInstall the server." |
|
||||
echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps." |
|
||||
} | column -s $'\t' -t |
|
||||
esac |
|
||||
exit |
|
||||
} |
|
||||
|
|
||||
|
|
||||
fn_getopt_unreal2(){ |
|
||||
case "$getopt" in |
|
||||
st|start) |
|
||||
command_start.sh;; |
|
||||
sp|stop) |
|
||||
command_stop.sh;; |
|
||||
r|restart) |
|
||||
fn_restart;; |
|
||||
u|update) |
|
||||
update_check.sh;; |
|
||||
fu|force-update|update-restart) |
|
||||
forceupdate=1; |
|
||||
update_check.sh;; |
|
||||
uf|update-functions) |
|
||||
update_functions.sh;; |
|
||||
v|validate) |
|
||||
command_validate.sh;; |
|
||||
m|monitor) |
|
||||
command_monitor.sh;; |
|
||||
et|email-test) |
|
||||
command_email_test.sh;; |
|
||||
d|details) |
|
||||
command_details.sh;; |
|
||||
b|backup) |
|
||||
command_backup.sh;; |
|
||||
c|console) |
|
||||
command_console.sh;; |
|
||||
d|debug) |
|
||||
command_debug.sh;; |
|
||||
dev|dev-debug) |
|
||||
command_dev_debug.sh;; |
|
||||
i|install) |
|
||||
command_install.sh;; |
|
||||
ai|auto-install) |
|
||||
fn_autoinstall;; |
|
||||
dd|depsdetect) |
|
||||
command_dev_detect_deps.sh;; |
|
||||
mc|map-compressor) |
|
||||
compress_unreal2_maps.sh;; |
|
||||
*) |
|
||||
echo "Usage: $0 [option]" |
|
||||
echo "${gamename} - Linux Game Server Manager - Version ${version}" |
|
||||
echo "http://gameservermanagers.com/${selfname}" |
|
||||
echo -e "" |
|
||||
echo -e "\e[93mCommands\e[0m" |
|
||||
{ |
|
||||
echo -e "\e[34mstart\t\e[0mStart the server." |
|
||||
echo -e "\e[34mstop\t\e[0mStop the server." |
|
||||
echo -e "\e[34mrestart\t\e[0mRestart the server." |
|
||||
echo -e "\e[34mupdate\t\e[0mChecks and applies updates from SteamCMD." |
|
||||
echo -e "\e[34mforce-update\t\e[0mBypasses the check and applies updates from SteamCMD." |
|
||||
echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." |
|
||||
echo -e "\e[34mvalidate\t\e[0mValidate server files with SteamCMD." |
|
||||
echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." |
|
||||
echo -e "\e[34memail-test\t\e[0mSends test monitor email." |
|
||||
echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." |
|
||||
echo -e "\e[34mbackup\t\e[0mCreate archive of the server." |
|
||||
echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." |
|
||||
echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." |
|
||||
echo -e "\e[34minstall\t\e[0mInstall the server." |
|
||||
echo -e "\e[34mauto-install\t\e[0mInstall the server, without prompts." |
|
||||
echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps." |
|
||||
} | column -s $'\t' -t |
|
||||
esac |
|
||||
exit |
|
||||
} |
|
||||
|
|
||||
|
|
||||
fn_getopt_ut2k4(){ |
|
||||
case "$getopt" in |
|
||||
st|start) |
|
||||
command_start.sh;; |
|
||||
sp|stop) |
|
||||
command_stop.sh;; |
|
||||
r|restart) |
|
||||
fn_restart;; |
|
||||
uf|update-functions) |
|
||||
update_functions.sh;; |
|
||||
m|monitor) |
|
||||
command_monitor.sh;; |
|
||||
et|email-test) |
|
||||
command_email_test.sh;; |
|
||||
d|details) |
|
||||
command_details.sh;; |
|
||||
b|backup) |
|
||||
command_backup.sh;; |
|
||||
c|console) |
|
||||
command_console.sh;; |
|
||||
d|debug) |
|
||||
command_debug.sh;; |
|
||||
dev|dev-debug) |
|
||||
command_dev_debug.sh;; |
|
||||
i|install) |
|
||||
command_install.sh;; |
|
||||
mc|map-compressor) |
|
||||
compress_unreal2_maps.sh;; |
|
||||
dd|depsdetect) |
|
||||
command_dev_detect_deps.sh;; |
|
||||
*) |
|
||||
echo "Usage: $0 [option]" |
|
||||
echo "${gamename} - Linux Game Server Manager - Version ${version}" |
|
||||
echo "http://gameservermanagers.com/${selfname}" |
|
||||
echo -e "" |
|
||||
echo -e "\e[93mCommands\e[0m" |
|
||||
{ |
|
||||
echo -e "\e[34mstart\t\e[0mStart the server." |
|
||||
echo -e "\e[34mstop\t\e[0mStop the server." |
|
||||
echo -e "\e[34mrestart\t\e[0mRestart the server." |
|
||||
echo -e "\e[34mupdate-functions\t\e[0mRemoves all functions so latest can be downloaded." |
|
||||
echo -e "\e[34mmonitor\t\e[0mChecks that the server is running." |
|
||||
echo -e "\e[34memail-test\t\e[0mSends test monitor email." |
|
||||
echo -e "\e[34mdetails\t\e[0mDisplays useful infomation about the server." |
|
||||
echo -e "\e[34mbackup\t\e[0mCreate archive of the server." |
|
||||
echo -e "\e[34mconsole\t\e[0mConsole allows you to access the live view of a server." |
|
||||
echo -e "\e[34mdebug\t\e[0mSee the output of the server directly to your terminal." |
|
||||
echo -e "\e[34minstall\t\e[0mInstall the server." |
|
||||
echo -e "\e[34mmap-compressor\t\e[0mCompresses all ${gamename} server maps." |
|
||||
} | column -s $'\t' -t |
|
||||
esac |
|
||||
exit |
|
||||
} |
|
||||
|
|
||||
if [ "${gamename}" == "Mumble" ]; then |
|
||||
fn_getopt_mumble |
|
||||
elif [ "${gamename}" == "Teamspeak 3" ]; then |
|
||||
fn_getopt_teamspeak3 |
|
||||
elif [ "${gamename}" == "Garry's Mod" ]; then |
|
||||
fn_getopt_gmodserver |
|
||||
elif [ "${engine}" == "unreal2" ]; then |
|
||||
if [ "${gamename}" == "Unreal Tournament 2004" ]; then |
|
||||
fn_getopt_ut2k4 |
|
||||
else |
|
||||
fn_getopt_unreal2 |
|
||||
fi |
|
||||
elif [ "${engine}" == "unreal" ]; then |
|
||||
fn_getopt_unreal |
|
||||
else |
|
||||
fn_getopt_generic |
|
||||
fi |
|
@ -1,148 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM fn_messages function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
# Description: Defines on-screen messages such as [ OK ] and how script logs look. |
|
||||
|
|
||||
# Date and servicename for log files. |
|
||||
fn_scriptlog(){ |
|
||||
if [ -n "${modulename}" ]; then |
|
||||
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${modulename}: ${1}" >> "${scriptlog}" |
|
||||
else |
|
||||
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
# [ FAIL ] |
|
||||
fn_printfail(){ |
|
||||
if [ -n "${modulename}" ]; then |
|
||||
echo -en "\r\033[K[\e[0;31m FAIL \e[0m] ${modulename} ${servicename}: $@" |
|
||||
else |
|
||||
echo -en "\r\033[K[\e[0;31m FAIL \e[0m] $@" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_printfailnl(){ |
|
||||
if [ -n "${modulename}" ]; then |
|
||||
echo -e "\r\033[K[\e[0;31m FAIL \e[0m] ${modulename} ${servicename}: $@" |
|
||||
else |
|
||||
echo -e "\r\033[K[\e[0;31m FAIL \e[0m] $@" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
# [ OK ] |
|
||||
fn_printok(){ |
|
||||
if [ -n "${modulename}" ]; then |
|
||||
echo -en "\r\033[K[\e[0;32m OK \e[0m] ${modulename} ${servicename}: $@" |
|
||||
else |
|
||||
echo -en "\r\033[K[\e[0;32m OK \e[0m] $@" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_printoknl(){ |
|
||||
if [ -n "${modulename}" ]; then |
|
||||
echo -e "\r\033[K[\e[0;32m OK \e[0m] ${modulename} ${servicename}: $@" |
|
||||
else |
|
||||
echo -e "\r\033[K[\e[0;32m OK \e[0m] $@" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
# [ INFO ] |
|
||||
fn_printinfo(){ |
|
||||
if [ -n "${modulename}" ]; then |
|
||||
echo -en "\r\033[K[\e[0;36m INFO \e[0m] ${modulename} ${servicename}: $@" |
|
||||
else |
|
||||
echo -en "\r\033[K[\e[0;36m INFO \e[0m] $@" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_printinfonl(){ |
|
||||
if [ -n "${modulename}" ]; then |
|
||||
echo -e "\r\033[K[\e[0;36m INFO \e[0m] ${modulename} ${servicename}: $@" |
|
||||
else |
|
||||
echo -e "\r\033[K[\e[0;36m INFO \e[0m] $@" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
# [ WARN ] |
|
||||
fn_printwarn(){ |
|
||||
if [ -n "${modulename}" ]; then |
|
||||
echo -en "\r\033[K[\e[1;33m WARN \e[0m] ${modulename} ${servicename}: $@" |
|
||||
else |
|
||||
echo -en "\r\033[K[\e[1;33m WARN \e[0m] $@" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_printwarnnl(){ |
|
||||
if [ -n "${modulename}" ]; then |
|
||||
echo -e "\r\033[K[\e[1;33m WARN \e[0m] ${modulename} ${servicename}: $@" |
|
||||
else |
|
||||
echo -e "\r\033[K[\e[1;33m WARN \e[0m] $@" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
# [ .... ] |
|
||||
fn_printdots(){ |
|
||||
if [ -n "${modulename}" ]; then |
|
||||
echo -en "\r\033[K[ .... ] ${modulename} ${servicename}: $@" |
|
||||
else |
|
||||
echo -en "\r\033[K[ .... ] $@" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
# Complete! |
|
||||
fn_printcomplete(){ |
|
||||
echo -en "\e[0;32mComplete!\e[0m $@" |
|
||||
} |
|
||||
|
|
||||
fn_printcompletenl(){ |
|
||||
echo -e "\e[0;32mComplete!\e[0m $@" |
|
||||
} |
|
||||
|
|
||||
# Warning! |
|
||||
fn_printwarning(){ |
|
||||
echo -en "\e[0;33mWarning!\e[0m $@" |
|
||||
} |
|
||||
|
|
||||
fn_printwarningnl(){ |
|
||||
echo -e "\e[0;33mWarning!\e[0m $@" |
|
||||
} |
|
||||
|
|
||||
# Failure! |
|
||||
fn_printfailure(){ |
|
||||
echo -en "\e[0;31mFailure!\e[0m $@" |
|
||||
} |
|
||||
|
|
||||
fn_printfailurenl(){ |
|
||||
echo -e "\e[0;31mFailure!\e[0m $@" |
|
||||
} |
|
||||
|
|
||||
# Error! |
|
||||
fn_printerror(){ |
|
||||
echo -en "\e[0;31mError!\e[0m $@" |
|
||||
} |
|
||||
|
|
||||
fn_printerrornl(){ |
|
||||
echo -e "\e[0;31mError!\e[0m $@" |
|
||||
} |
|
||||
|
|
||||
# Info! |
|
||||
fn_printinfomation(){ |
|
||||
echo -en "\e[0;36mInfo!\e[0m $@" |
|
||||
} |
|
||||
|
|
||||
fn_printinfomationnl(){ |
|
||||
echo -e "\e[0;36mInfo!\e[0m $@" |
|
||||
} |
|
||||
|
|
||||
# FAIL for end of line |
|
||||
fn_printokeol(){ |
|
||||
echo -e "\e[0;32mOK\e[0m" |
|
||||
} |
|
||||
|
|
||||
# FAIL for end of line |
|
||||
fn_printfaileol(){ |
|
||||
echo -e "\e[0;31mFAIL\e[0m\n" |
|
||||
} |
|
@ -1,67 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM email.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="020216" |
|
||||
|
|
||||
# Description: Sends email notification if monitor picks up a failure. |
|
||||
|
|
||||
local modulename="Email" |
|
||||
fn_printdots "Sending notification to ${email}" |
|
||||
info_distro.sh |
|
||||
info_config.sh |
|
||||
check_ip.sh |
|
||||
fn_parms |
|
||||
{ |
|
||||
echo -e "========================================\n${servicename} details\n========================================" |
|
||||
echo -e "Service name: ${servicename}" |
|
||||
echo -e "Server name: ${servername}" |
|
||||
echo -e "Game name: ${gamename}" |
|
||||
echo -e "Server IP: ${ip}:${port}" |
|
||||
echo -e "Failure reason: ${failurereason}" |
|
||||
echo -e "Action Taken: ${actiontaken}\n" |
|
||||
echo -e "" |
|
||||
echo -e "========================================\nDistro Details\n========================================" |
|
||||
echo -e "Date: $(date)" |
|
||||
echo -e "Distro: ${os}" |
|
||||
echo -e "Arch: ${arch}" |
|
||||
echo -e "Kernel: ${kernel}" |
|
||||
echo -e "Hostname: $HOSTNAME" |
|
||||
echo -e "tmux: ${tmuxv}" |
|
||||
echo -e "GLIBC: ${glibcv}" |
|
||||
echo -e "" |
|
||||
echo -e "========================================\nPerformance\n========================================" |
|
||||
echo -e "Uptime: ${days}d, ${hours}h, ${minutes}m" |
|
||||
echo -e "Avg Load: ${load}" |
|
||||
echo -e "" |
|
||||
echo -e "Mem: total used free" |
|
||||
echo -e "Physical: ${physmemtotal} ${physmemused} ${physmemfree}" |
|
||||
echo -e "Swap: ${swaptotal}${swapused} ${swapfree}" |
|
||||
echo -e "" |
|
||||
echo -e "========================================\nStorage\n========================================" |
|
||||
echo -e "\e[34mFilesystem:\t\e[0m${filesystem}" |
|
||||
echo -e "\e[34mTotal:\t\e[0m${totalspace}" |
|
||||
echo -e "\e[34mUsed:\t\e[0m${usedspace}" |
|
||||
echo -e "\e[34mAvailable:\t\e[0m${availspace}" |
|
||||
echo -e "\e[34mServerfiles:\t\e[0m${filesdirdu}" |
|
||||
if [ -d "${backupdir}" ]; then |
|
||||
echo -e "\e[34mBackups:\t\e[0m${backupdirdu}" |
|
||||
fi |
|
||||
echo -e "" |
|
||||
echo -e "========================================\nLogs\n========================================" |
|
||||
}| sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee "${scriptlogdir}/${servicename}-email.log" > /dev/null 2>&1 |
|
||||
echo -e "\n\n Script log\n===================" >> "${emaillog}" |
|
||||
tail -25 "${scriptlog}" >> "${emaillog}" |
|
||||
if [ ! -z "${consolelog}" ]; then |
|
||||
echo -e "\n\n Console log\n====================" >> "${emaillog}" |
|
||||
tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }' >> "${emaillog}" |
|
||||
fi |
|
||||
if [ ! -z "${gamelogdir}" ]; then |
|
||||
echo -e "\n\n Server log\n====================" >> "${emaillog}" |
|
||||
tail "${gamelogdir}"/* | grep -v "==>" | sed '/^$/d' | tail -25 >> "${emaillog}" |
|
||||
fi |
|
||||
mail -s "${subject}" ${email} < "${emaillog}" |
|
||||
fn_printok "Sending notification to ${email}" |
|
||||
fn_scriptlog "Sent notification to ${email}" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
@ -1,33 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM fix_arma3.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="301215" |
|
||||
|
|
||||
# Fixes line 63: 20150 Segmentation fault (core dumped) #488 |
|
||||
|
|
||||
fn_msg_start(){ |
|
||||
fn_printdots "Applying ${fixname} fix: ${gamename}" |
|
||||
sleep 1 |
|
||||
fn_printinfo "Applying ${fixname} fix: ${gamename}" |
|
||||
fn_scriptlog "Applying ${fixname} fix: ${gamename}" |
|
||||
sleep 1 |
|
||||
} |
|
||||
|
|
||||
fn_msg_end(){ |
|
||||
if [ $? -ne 0 ]; then |
|
||||
fn_printfailnl "Applying ${fixname} fix: ${gamename}" |
|
||||
fn_scriptlog "Failure! Applying ${fixname} fix: ${gamename}" |
|
||||
else |
|
||||
fn_printoknl "Applying ${fixname} fix: ${gamename}" |
|
||||
fn_scriptlog "Complete! Applying ${fixname} fix: ${gamename}" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
# Fixes: server not always creating steam_appid.txt file. |
|
||||
if [ ! -d "${rootdir}/.local/share/Arma\ 3" ]; then |
|
||||
local fixname="20150 Segmentation fault (core dumped)" |
|
||||
fn_msg_start |
|
||||
mkdir -p "${rootdir}/.local/share/Arma\ 3" |
|
||||
fn_msg_end |
|
||||
fi |
|
@ -1,34 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM fix_dst.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="020116" |
|
||||
|
|
||||
# Fixes line 63: 20150 Segmentation fault (core dumped) #488 |
|
||||
|
|
||||
fn_msg_start(){ |
|
||||
fn_printdots "Applying ${fixname} fix: ${gamename}" |
|
||||
sleep 1 |
|
||||
fn_printinfo "Applying ${fixname} fix: ${gamename}" |
|
||||
fn_scriptlog "Applying ${fixname} fix: ${gamename}" |
|
||||
sleep 1 |
|
||||
} |
|
||||
|
|
||||
fn_msg_end(){ |
|
||||
if [ $? -ne 0 ]; then |
|
||||
fn_printfailnl "Applying ${fixname} fix: ${gamename}" |
|
||||
fn_scriptlog "Failure! Applying ${fixname} fix: ${gamename}" |
|
||||
else |
|
||||
fn_printoknl "Applying ${fixname} fix: ${gamename}" |
|
||||
fn_scriptlog "Complete! Applying ${fixname} fix: ${gamename}" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
# Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer) |
|
||||
# Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS. |
|
||||
if [ -f "/etc/redhat-release" ] && [ ! -f "${filesdir}/bin/lib32/libcurl-gnutls.so.4" ]; then |
|
||||
local fixname="libcurl-gnutls.so.4 missing" |
|
||||
fn_msg_start |
|
||||
ln -s "/usr/lib/libcurl.so.4" "${filesdir}/bin/lib32/libcurl-gnutls.so.4" |
|
||||
fn_msg_end |
|
||||
fi |
|
@ -1,144 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM fix_glibc.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="020116" |
|
||||
|
|
||||
fn_glibcfixmsg(){ |
|
||||
echo "" |
|
||||
echo "GLIBC Fix required" |
|
||||
echo "============================" |
|
||||
sleep 1 |
|
||||
fn_printwarningnl "${gamename} requires GLIBC_${glibcversion} or above" |
|
||||
sleep 1 |
|
||||
echo "" |
|
||||
echo -e "Currently installed:\e[0;31m GLIBC_$(ldd --version |grep ldd|awk '{print $NF}')\e[0;39m" |
|
||||
echo -e "Required: =>\e[0;32m GLIBC_${glibcversion}\e[0;39m" |
|
||||
echo "" |
|
||||
sleep 1 |
|
||||
echo "The installer will now detect and download the required files to allow ${gamename} server to run on a distro with less than GLIBC_${glibcversion}." |
|
||||
echo "note: This will NOT upgrade GLIBC on your system." |
|
||||
echo "" |
|
||||
echo "http://gameservermanagers.com/glibcfix" |
|
||||
sleep 1 |
|
||||
echo "" |
|
||||
echo -en "loading required files.\r" |
|
||||
sleep 1 |
|
||||
echo -en "loading required files..\r" |
|
||||
sleep 1 |
|
||||
echo -en "loading required files...\r" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
} |
|
||||
|
|
||||
# if ldd command not detected |
|
||||
if [ -z $(command -v ldd) ]; then |
|
||||
echo "" |
|
||||
fn_printfailurenl "GLIBC is not detected" |
|
||||
sleep 1 |
|
||||
echo "Install GLIBC and retry installation." |
|
||||
sleep 1 |
|
||||
echo "" |
|
||||
while true; do |
|
||||
read -e -i "y" -p "Continue install? [Y/n]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) break;; |
|
||||
[Nn]* ) echo Exiting; exit;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
# if Glibc less than 1.15 |
|
||||
elif [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt 215 ]; then |
|
||||
# Blade Symphony |
|
||||
if [ "${gamename}" == "Blade Symphony" ]; then |
|
||||
glibcversion="2.15" |
|
||||
fn_glibcfixmsg |
|
||||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|
||||
# Dont Starve Together |
|
||||
elif [ "${gamename}" == "Don't Starve Together" ]; then |
|
||||
glibcversion="2.15" |
|
||||
fn_glibcfixmsg |
|
||||
cd "${filesdir}/bin/lib32/" |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/DontStarveTogether/dependencies/libc.so.6 |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/DontStarveTogether/dependencies/libpthread.so.0 |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/DontStarveTogether/dependencies/librt.so.1 |
|
||||
# Double Action: Boogaloo |
|
||||
elif [ "${gamename}" == "Double Action: Boogaloo" ]; then |
|
||||
glibcversion="2.15" |
|
||||
fn_glibcfixmsg |
|
||||
cd "${filesdir}" |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/blob/master/DoubleActionBoogaloo/dependencies/libm.so.6 |
|
||||
# Fistful of Frags |
|
||||
elif [ "${gamename}" == "Fistful of Frags" ]; then |
|
||||
glibcversion="2.15" |
|
||||
fn_glibcfixmsg |
|
||||
cd "${filesdir}" |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/FistfulOfFrags/dependencies/libm.so.6 |
|
||||
# Garry's Mod |
|
||||
elif [ "${gamename}" == "Garry's Mod" ]; then |
|
||||
glibcversion="2.15" |
|
||||
fn_glibcfixmsg |
|
||||
cd "${filesdir}/bin" |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libc.so.6 |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libm.so.6 |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/GarrysMod/dependencies/libpthread.so.0 |
|
||||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|
||||
# Insurgency |
|
||||
elif [ "${gamename}" == "Insurgency" ]; then |
|
||||
glibcversion="2.15" |
|
||||
fn_glibcfixmsg |
|
||||
cd "${filesdir}/bin" |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libc.so.6 |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libm.so.6 |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/librt.so.1 |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/Insurgency/dependencies/libpthread.so.0 |
|
||||
elif [ "${gamename}" == "Left 4 Dead" ]; then |
|
||||
glibcversion="2.07" |
|
||||
fn_glibcfixmsg |
|
||||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/bin/libstdc++.so.6" |
|
||||
# Natural Selection 2 |
|
||||
elif [ "${gamename}" == "Natural Selection 2" ]; then |
|
||||
glibcversion="2.15" |
|
||||
fn_glibcfixmsg |
|
||||
cd "${filesdir}" |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NaturalSelection2/dependencies/libm.so.6 |
|
||||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|
||||
# NS2: Combat |
|
||||
elif [ "${gamename}" == "NS2: Combat" ]; then |
|
||||
glibcversion="2.15" |
|
||||
fn_glibcfixmsg |
|
||||
cd "${filesdir}" |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NS2Combat/dependencies/libm.so.6 |
|
||||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|
||||
# No More Room in Hell |
|
||||
elif [ "${gamename}" == "No More Room in Hell" ]; then |
|
||||
glibcversion="2.15" |
|
||||
fn_glibcfixmsg |
|
||||
cd "${filesdir}" |
|
||||
wget -nv -N https://github.com/dgibbs64/linuxgsm/raw/master/NoMoreRoomInHell/dependencies/libm.so.6 |
|
||||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|
||||
# if Glibc less than 1.13 |
|
||||
elif [ "$(ldd --version | sed -n '1 p' | tr -cd '[:digit:]' | tail -c 3)" -lt 213 ]; then |
|
||||
# ARMA 3 |
|
||||
if [ "${gamename}" == "ARMA 3" ]; then |
|
||||
glibcversion="2.13" |
|
||||
fn_glibcfixmsg |
|
||||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|
||||
# Just Cause 2 |
|
||||
elif [ "${gamename}" == "Just Cause 2" ]; then |
|
||||
glibcversion="2.13" |
|
||||
fn_glibcfixmsg |
|
||||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/libstdc++.so.6" |
|
||||
# Serious Sam 3: BFE |
|
||||
elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then |
|
||||
glibcversion="2.13" |
|
||||
fn_glibcfixmsg |
|
||||
cp -v "${rootdir}/steamcmd/linux32/libstdc++.so.6" "${filesdir}/Bin/libstdc++.so.6" |
|
||||
else |
|
||||
: # Else glibcfix not required. |
|
||||
fi |
|
||||
else |
|
||||
: #Else glibcfix not required. |
|
||||
fi |
|
||||
fi |
|
||||
sleep 1 |
|
@ -1,15 +1,14 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
# LGSM core_getopt.sh function |
# LGSM fn_getopt.sh function |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
lgsm_version="271215" |
lgsm_version="210516" |
||||
|
|
||||
# Description: Redirect to new core_getopt.sh |
# Description: REDIRECT FUNCTION to new core_getopt.sh |
||||
|
|
||||
core_getopt.sh(){ |
core_getopt.sh(){ |
||||
# Functions are defined in core_functions.sh. |
|
||||
functionfile="${FUNCNAME}" |
functionfile="${FUNCNAME}" |
||||
fn_runfunction |
fn_fetch_core_dl |
||||
} |
} |
||||
|
|
||||
core_getopt.sh |
core_getopt.sh |
@ -1,22 +1,15 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
# LGSM update_functions.sh function |
# LGSM fn_update_functions function |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
lgsm_version="230116" |
lgsm_version="210516" |
||||
|
|
||||
# Description: LEGACY FUNCTION Deletes the functions dir to allow re-downloading of functions from GitHub. |
# Description: REDIRECT FUNCTION to new command_update_functions.sh |
||||
|
|
||||
|
command_update_functions.sh(){ |
||||
|
functionfile="${FUNCNAME}" |
||||
|
fn_runfunction |
||||
|
} |
||||
|
|
||||
|
command_update_functions.sh |
||||
|
|
||||
fn_printdots "Updating functions" |
|
||||
fn_scriptlog "Updating functions" |
|
||||
sleep 1 |
|
||||
echo -ne "\n" |
|
||||
rm -rfv "${rootdir}/functions/"* |
|
||||
exitcode=$? |
|
||||
if [ "${exitcode}" == "0" ]; then |
|
||||
fn_printok "Updating functions" |
|
||||
fn_scriptlog "Success! Updating functions" |
|
||||
else |
|
||||
fn_printfail "Updating functions" |
|
||||
fn_scriptlog "Failure! Updating functions" |
|
||||
fi |
|
||||
echo -ne "\n" |
|
@ -1,868 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM info_config.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="190216" |
|
||||
|
|
||||
# Description: Gets specific details from config files. |
|
||||
|
|
||||
## Examples of filtering to get info from config files |
|
||||
# sed 's/foo//g' - remove foo |
|
||||
# tr -cd '[:digit:]' leave only digits |
|
||||
# tr -d '=\"; ' remove selected charectors =\"; |
|
||||
# grep -v "foo" filter out lines that contain foo |
|
||||
|
|
||||
## Just Cause 2 |
|
||||
if [ "${engine}" == "avalanche" ]; then |
|
||||
|
|
||||
# server name |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
servername=$(grep "Name" "${servercfgfullpath}" | sed 's/Name//g' | tr -d '=", \n') |
|
||||
if [ ! -n "${servername}" ]; then |
|
||||
servername="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# ip |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
# check if the ip exists in the config file. Failing this will fall back to the default. |
|
||||
configipcheck=$(grep "BindIP" "${servercfgfullpath}" | sed 's/BindIP//g' | tr -d '=", \n') |
|
||||
fi |
|
||||
if [ -n "${configipcheck}" ]; then |
|
||||
ip=$(grep "BindIP" "${servercfgfullpath}" | sed 's/BindIP//g' | tr -d '=", \n') |
|
||||
fi |
|
||||
|
|
||||
# server password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
serverpassword=$(grep "Password" "${servercfgfullpath}" | sed 's/Password//g' | tr -d '=", \n') |
|
||||
if [ ! -n "${serverpassword}" ]; then |
|
||||
serverpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# slots |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
slots=$(grep "MaxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
if [ ! -n "${slots}" ]; then |
|
||||
slots="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
port=$(grep "BindPort" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${port}" ]; then |
|
||||
port="0" |
|
||||
fi |
|
||||
|
|
||||
## Dont Starve Together |
|
||||
elif [ "${engine}" == "dontstarve" ]; then |
|
||||
|
|
||||
# server name |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
servername=$(grep "default_server_name = " "${servercfgfullpath}" | sed 's/default_server_name = //g') |
|
||||
if [ ! -n "${servername}" ]; then |
|
||||
servername="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# server password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
serverpassword=$(grep "server_password = " "${servercfgfullpath}" | grep -v "#" | sed 's/server_password = //g') |
|
||||
if [ ! -n "${serverpassword}" ]; then |
|
||||
serverpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# slots |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
slots=$(grep "max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') |
|
||||
if [ ! -n "${slots}" ]; then |
|
||||
slots="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# game mode |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
gamemode=$(grep "game_mode = " "${servercfgfullpath}" | grep -v "#" | sed 's/game_mode = //g') |
|
||||
if [ ! -n "${gamemode}" ]; then |
|
||||
gamemode="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
gamemode="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# tickrate |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
tickrate=$(grep "tick_rate" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') |
|
||||
if [ ! -n "${tickrate}" ]; then |
|
||||
tickrate="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
tickrate="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
port=$(grep "server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${port}" ]; then |
|
||||
port="0" |
|
||||
fi |
|
||||
|
|
||||
## Project Zomboid |
|
||||
elif [ "${engine}" == "projectzomboid" ]; then |
|
||||
|
|
||||
# server name |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
servername=$(grep "PublicName=" "${servercfgfullpath}" | sed 's/PublicName=//g' | tr -d '=", \n') |
|
||||
if [ ! -n "${servername}" ]; then |
|
||||
servername="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# slots |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') |
|
||||
if [ ! -n "${slots}" ]; then |
|
||||
slots="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
port=$(grep "DefaultPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${port}" ]; then |
|
||||
port="0" |
|
||||
fi |
|
||||
|
|
||||
|
|
||||
# Quake Live |
|
||||
elif [ "${engine}" == "idtech3" ]; then |
|
||||
|
|
||||
# server name |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
servername=$(grep "set sv_hostname " "${servercfgfullpath}" | sed 's/set sv_hostname //g' | tr -d '=\"; ') |
|
||||
if [ ! -n "${servername}" ]; then |
|
||||
servername="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# server password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
|
|
||||
serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/set g_password//g' | tr -d '=\"; '| cut -f1 -d "/") |
|
||||
if [ ! -n "${serverpassword}" ]; then |
|
||||
serverpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# rcon password |
|
||||
rconpassword="${rconpassword}" |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
if [ ! -n "${rconpassword}" ]; then |
|
||||
rconpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
rconpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# slots |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
slots=$(grep "set sv_maxClients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') |
|
||||
if [ ! -n "${slots}" ]; then |
|
||||
slots="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# port |
|
||||
port="${gameport}" |
|
||||
if [ ! -n "${port}" ]; then |
|
||||
port="0" |
|
||||
fi |
|
||||
|
|
||||
# rcon port |
|
||||
if [ ! -n "${rconport}" ]; then |
|
||||
rconport="0" |
|
||||
fi |
|
||||
|
|
||||
# Stats port |
|
||||
if [ ! -n "${statsport}" ]; then |
|
||||
statsport="0" |
|
||||
fi |
|
||||
|
|
||||
# ARMA 3 |
|
||||
elif [ "${engine}" == "realvirtuality" ]; then |
|
||||
|
|
||||
# server name |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
servername=$(grep "hostname" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\<hostname\>//g' | tr -d '=\"; ') |
|
||||
if [ ! -n "${servername}" ]; then |
|
||||
servername="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# admin password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\passwordAdmin//g' | tr -d '=\"; ') |
|
||||
if [ ! -n "${adminpassword}" ]; then |
|
||||
adminpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
adminpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# server password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
serverpassword=$(grep "password =" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\password//g' | tr -d '=\"; ') |
|
||||
if [ ! -n "${serverpassword}" ]; then |
|
||||
serverpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# slots |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
slots=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') |
|
||||
if [ ! -n "${slots}" ]; then |
|
||||
slots="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# port |
|
||||
if [ "${port}" != "" ]; then |
|
||||
port=${port} |
|
||||
fi |
|
||||
if [ ! -n "${port}" ]; then |
|
||||
port="0" |
|
||||
fi |
|
||||
|
|
||||
# query port |
|
||||
if [ "${port}" != "" ]; then |
|
||||
queryport=$((port+1)) |
|
||||
fi |
|
||||
if [ ! -n "${queryport}" ]; then |
|
||||
queryport="0" |
|
||||
fi |
|
||||
|
|
||||
# master port |
|
||||
if [ "${port}" != "" ]; then |
|
||||
masterport=$((port+2)) |
|
||||
fi |
|
||||
if [ ! -n "${masterport}" ]; then |
|
||||
masterport="0" |
|
||||
fi |
|
||||
|
|
||||
# Serious Sam |
|
||||
elif [ "${engine}" == "seriousengine35" ]; then |
|
||||
|
|
||||
# server name |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
servername=$(grep "prj_strMultiplayerSessionName" "${servercfgfullpath}" | sed 's/prj_strMultiplayerSessionName = //g' | tr -d '=\"; ') |
|
||||
if [ ! -n "${servername}" ]; then |
|
||||
servername="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# rcon password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed 's/rcts_strAdminPassword = //g' | tr -d '=\"; ') |
|
||||
if [ ! -n "${rconpassword}" ]; then |
|
||||
rconpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
rconpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# slots |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
slots=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') |
|
||||
if [ ! -n "${slots}" ]; then |
|
||||
slots="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# game mode |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
gamemode=$(grep "gam_idGameMode" "${servercfgfullpath}" | grep -v "#" | sed 's/gam_idGameMode//g' | tr -d '=\"; ') |
|
||||
if [ ! -n "${gamemode}" ]; then |
|
||||
gamemode="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
gamemode="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
port=$(grep "prj_uwPort" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${port}" ]; then |
|
||||
port="0" |
|
||||
fi |
|
||||
|
|
||||
# query port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
queryport=$((${port} + 1)) |
|
||||
fi |
|
||||
if [ ! -n "${queryport}" ]; then |
|
||||
queryport="0" |
|
||||
fi |
|
||||
|
|
||||
# Source Engine Games |
|
||||
elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then |
|
||||
|
|
||||
# server name |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
servername=$(grep "hostname" "${servercfgfullpath}" | sed 's/hostname //g' | sed 's/"//g') |
|
||||
if [ ! -n "${servername}" ]; then |
|
||||
servername="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# server password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed 's/sv_password //g' | sed 's/"//g') |
|
||||
if [ ! -n "${serverpassword}" ]; then |
|
||||
serverpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# rcon password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed 's/rcon_password //g' | sed 's/"//g') |
|
||||
if [ ! -n "${rconpassword}" ]; then |
|
||||
rconpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
rconpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# Spark (NS2: Combat) |
|
||||
elif [ "${engine}" == "spark" ]; then |
|
||||
|
|
||||
# query port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
queryport=$((port + 1)) |
|
||||
fi |
|
||||
if [ ! -n "${queryport}" ]; then |
|
||||
queryport="0" |
|
||||
fi |
|
||||
|
|
||||
# Teamspeak 3 |
|
||||
elif [ "${gamename}" == "Teamspeak 3" ]; then |
|
||||
|
|
||||
# ip |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
# check if the ip exists in the config file. Failing this will fall back to the default. |
|
||||
configipcheck=$(grep "voice_ip=" "${servercfgfullpath}" | sed 's/\voice_ip=//g') |
|
||||
fi |
|
||||
if [ -n "${configipcheck}" ]; then |
|
||||
ip=$(grep "voice_ip=" "${servercfgfullpath}" | sed 's/\voice_ip=//g') |
|
||||
fi |
|
||||
|
|
||||
# dbplugin |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed 's/\dbplugin=//g') |
|
||||
if [ ! -n "${dbplugin}" ]; then |
|
||||
dbplugin="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
dbplugin="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
port=$(grep "default_voice_port=" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${port}" ]; then |
|
||||
port="9987" |
|
||||
fi |
|
||||
|
|
||||
# query port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
queryport=$(grep "query_port=" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${queryport}" ]; then |
|
||||
queryport="10011" |
|
||||
fi |
|
||||
|
|
||||
# file port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
fileport=$(grep "filetransfer_port=" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${fileport}" ]; then |
|
||||
fileport="30033" |
|
||||
fi |
|
||||
|
|
||||
# Teeworlds |
|
||||
elif [ "${engine}" == "teeworlds" ]; then |
|
||||
|
|
||||
# server name |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
servername=$(grep "sv_name" "${servercfgfullpath}" | sed 's/sv_name //g' | sed 's/"//g') |
|
||||
if [ ! -n "${servername}" ]; then |
|
||||
servername="unnamed server" |
|
||||
fi |
|
||||
else |
|
||||
servername="unnamed server" |
|
||||
fi |
|
||||
|
|
||||
# server password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
serverpassword=$(grep "password " "${servercfgfullpath}" | awk '!/sv_rcon_password/'| sed 's/password //g' | tr -d '=\"; ') |
|
||||
if [ ! -n "${serverpassword}" ]; then |
|
||||
serverpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# rcon password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed 's/sv_rcon_password //g' | tr -d '=\"; ') |
|
||||
if [ ! -n "${rconpassword}" ]; then |
|
||||
rconpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
rconpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${port}" ]; then |
|
||||
port="8303" |
|
||||
fi |
|
||||
|
|
||||
# slots |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
slots=$(grep "sv_max_clients" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
if [ ! -n "${slots}" ]; then |
|
||||
slots="12" |
|
||||
fi |
|
||||
else |
|
||||
slots="12" |
|
||||
fi |
|
||||
|
|
||||
# Terraria |
|
||||
elif [ "${engine}" == "terraria" ]; then |
|
||||
|
|
||||
# port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
port=$(grep "port=" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${port}" ]; then |
|
||||
port="0" |
|
||||
fi |
|
||||
|
|
||||
# 7 Day To Die (unity3d) |
|
||||
elif [ "${gamename}" == "7 Days To Die" ]; then |
|
||||
|
|
||||
# server name |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") |
|
||||
if [ ! -n "${servername}" ]; then |
|
||||
servername="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# server password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") |
|
||||
if [ ! -n "${serverpassword}" ]; then |
|
||||
serverpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# webadmin enabled |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") |
|
||||
if [ ! -n "${webadminenabled}" ]; then |
|
||||
webadminenabled="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
webadminenabled="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# webadmin port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${webadminport}" ]; then |
|
||||
webadminport="0" |
|
||||
fi |
|
||||
|
|
||||
# webadmin enabled |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") |
|
||||
if [ ! -n "${webadminenabled}" ]; then |
|
||||
webadminenabled="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
webadminenabled="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# webadmin password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") |
|
||||
if [ ! -n "${webadminpass}" ]; then |
|
||||
webadminpass="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
webadminpass="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# telnet enabled |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") |
|
||||
if [ ! -n "${telnetenabled}" ]; then |
|
||||
telnetenabled="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
telnetenabled="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# telnet port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${telnetport}" ]; then |
|
||||
telnetport="0" |
|
||||
fi |
|
||||
|
|
||||
# telnet password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") |
|
||||
if [ ! -n "${telnetpass}" ]; then |
|
||||
telnetpass="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
telnetpass="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# slots |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
slots=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
if [ ! -n "${slots}" ]; then |
|
||||
slots="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# game mode |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") |
|
||||
if [ ! -n "${gamemode}" ]; then |
|
||||
gamemode="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
gamemode="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# game world |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") |
|
||||
if [ ! -n "${gameworld}" ]; then |
|
||||
gameworld="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
gameworld="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${port}" ]; then |
|
||||
port="0" |
|
||||
fi |
|
||||
|
|
||||
# query port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
queryport=$((port + 1)) |
|
||||
fi |
|
||||
if [ ! -n "${queryport}" ]; then |
|
||||
queryport="0" |
|
||||
fi |
|
||||
|
|
||||
# Hurtworld (unity3d) |
|
||||
elif [ "${gamename}" == "Hurtworld" ]; then |
|
||||
|
|
||||
# server name |
|
||||
if [ -n "${servername}" ]; then |
|
||||
servername="${servername}" |
|
||||
else |
|
||||
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# server password |
|
||||
# not available yet |
|
||||
|
|
||||
# slots |
|
||||
if [ -n "${maxplayers}" ]; then |
|
||||
slots="${maxplayers}" |
|
||||
else |
|
||||
slots="NOT SET" |
|
||||
fi |
|
||||
|
|
||||
# game world |
|
||||
if [ -n "${map}" ]; then |
|
||||
gameworld="${map}" |
|
||||
else |
|
||||
gameworld="NO MAP SET" |
|
||||
fi |
|
||||
|
|
||||
# port |
|
||||
if [ -n "${port}" ]; then |
|
||||
port="${port}" |
|
||||
else |
|
||||
port="0" |
|
||||
fi |
|
||||
|
|
||||
# query port |
|
||||
if [ -n "${queryport}" ]; then |
|
||||
queryport="${queryport}" |
|
||||
else |
|
||||
queryport="0" |
|
||||
fi |
|
||||
|
|
||||
# Unreal Tournament |
|
||||
elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then |
|
||||
|
|
||||
# server name |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
servername=$(grep "ServerName=" "${servercfgfullpath}" | sed 's/ServerName=//g') |
|
||||
if [ ! -n "${servername}" ]; then |
|
||||
servername="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# server password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
serverpassword=$(grep "GamePassword=" "${servercfgfullpath}" | sed 's/GamePassword=//g') |
|
||||
if [ ! -n "${serverpassword}" ]; then |
|
||||
serverpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# admin password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
adminpassword=$(grep "AdminPassword=" "${servercfgfullpath}" | sed 's/AdminPassword=//g') |
|
||||
if [ ! -n "${adminpassword}" ]; then |
|
||||
adminpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
adminpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
port=$(grep "Port=" "${servercfgfullpath}" | grep -v "Master" | grep -v "LAN" | grep -v "Proxy" | grep -v "Listen" | tr -d '\r' | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${port}" ]; then |
|
||||
port="0" |
|
||||
fi |
|
||||
|
|
||||
# query port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
queryport=$((port + 1)) |
|
||||
fi |
|
||||
if [ ! -n "${queryport}" ]; then |
|
||||
queryport="0" |
|
||||
fi |
|
||||
|
|
||||
# gamespy query port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
gsqueryport=$(grep "OldQueryPortNumber=" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${gsqueryport}" ]; then |
|
||||
gsqueryport="0" |
|
||||
fi |
|
||||
|
|
||||
# query port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
udplinkport=$((port + 2)) |
|
||||
fi |
|
||||
if [ ! -n "${udplinkport}" ]; then |
|
||||
udplinkport="0" |
|
||||
fi |
|
||||
|
|
||||
# webadmin enabled |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
webadminenabled=$(grep "bEnabled=" "${servercfgfullpath}" | sed 's/bEnabled=//g' | tr -d '\r') |
|
||||
if [ ! -n "${webadminenabled}" ]; then |
|
||||
webadminenabled="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
webadminenabled="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# webadmin port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
webadminport=$(grep "ListenPort=" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${webadminport}" ]; then |
|
||||
webadminport="0" |
|
||||
fi |
|
||||
|
|
||||
if [ "${engine}" == "unreal" ]; then |
|
||||
|
|
||||
# webadmin user |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
webadminuser=$(grep "AdminUsername=" "${servercfgfullpath}" | sed 's/\AdminUsername=//g') |
|
||||
if [ ! -n "${webadminuser}" ]; then |
|
||||
webadminuser="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
webadminuser="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# webadmin password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 2 | grep "AdminPassword=" | sed 's/\AdminPassword=//g') |
|
||||
if [ ! -n "${webadminpass}" ]; then |
|
||||
webadminpass="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
webadminpass="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
else |
|
||||
|
|
||||
# webadmin user |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
webadminuser=$(grep "AdminName=" "${servercfgfullpath}" | sed 's/\AdminName=//g') |
|
||||
if [ ! -n "${webadminuser}" ]; then |
|
||||
webadminuser="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
webadminuser="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# webadmin password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
webadminpass=$(grep "AdminPassword=" "${servercfgfullpath}" | sed 's/\AdminPassword=//g') |
|
||||
if [ ! -n "${webadminpass}" ]; then |
|
||||
webadminpass="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
webadminpass="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
fi |
|
||||
|
|
||||
# ARK: Survivaial Evolved |
|
||||
elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then |
|
||||
|
|
||||
# server name |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
servername=$(grep "SessionName=" "${servercfgfullpath}" | sed 's/SessionName=//g') |
|
||||
if [ ! -n "${servername}" ]; then |
|
||||
servername="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# server password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
serverpassword=$(grep "ServerPassword=" "${servercfgfullpath}" | sed 's/ServerPassword=//g') |
|
||||
if [ ! -n "${serverpassword}" ]; then |
|
||||
serverpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# admin password |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
adminpassword=$(grep "ServerAdminPassword=" "${servercfgfullpath}" | sed 's/ServerAdminPassword=//g') |
|
||||
if [ ! -n "${adminpassword}" ]; then |
|
||||
adminpassword="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
adminpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# slots |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
if [ ! -n "${slots}" ]; then |
|
||||
slots="NOT SET" |
|
||||
fi |
|
||||
else |
|
||||
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
||||
fi |
|
||||
|
|
||||
# port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
port=$(grep "Port=" "${servercfgfullpath}" | grep -v "RCONPort=" | grep -v "QueryPort=" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${port}" ]; then |
|
||||
port="0" |
|
||||
fi |
|
||||
|
|
||||
# rcon port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
rconport=$(grep "RCONPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${rconport}" ]; then |
|
||||
rconport="0" |
|
||||
fi |
|
||||
|
|
||||
# query port |
|
||||
if [ -f "${servercfgfullpath}" ]; then |
|
||||
queryport=$(grep "QueryPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') |
|
||||
fi |
|
||||
if [ ! -n "${queryport}" ]; then |
|
||||
queryport="0" |
|
||||
fi |
|
||||
|
|
||||
fi |
|
@ -1,10 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM info_ts3status.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
# Checks the status of Teamspeak 3. |
|
||||
|
|
||||
cd "${executabledir}" |
|
||||
ts3status=$(./ts3server_startscript.sh status servercfgfullpathfile=${servercfgfullpath}) |
|
@ -1,54 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM install_dl_ut2k4.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
echo "" |
|
||||
echo "Downloading Server Files" |
|
||||
echo "=================================" |
|
||||
sleep 1 |
|
||||
cd "${filesdir}" |
|
||||
if [ ! -f dedicatedserver3339-bonuspack.zip ]; then |
|
||||
wget http://gameservermanagers.com/files/ut2004/dedicatedserver3339-bonuspack.zip |
|
||||
else |
|
||||
echo "dedicatedserver3339-bonuspack.zip already downloaded!" |
|
||||
fi |
|
||||
echo "Running MD5 checksum to verify the file" |
|
||||
sleep 1 |
|
||||
echo "MD5 checksum: d3f28c5245c4c02802d48e4f0ffd3e34" |
|
||||
md5check=$(md5sum dedicatedserver3339-bonuspack.zip|awk '{print $1;}') |
|
||||
echo "File returned: ${md5check}" |
|
||||
if [ "${md5check}" != "d3f28c5245c4c02802d48e4f0ffd3e34" ]; then |
|
||||
echo "MD5 checksum: FAILED!" |
|
||||
read -p "Retry download? [y/N]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) rm -fv dedicatedserver3339-bonuspack.zip; install_dl_ut2k4.sh;; |
|
||||
[Nn]* ) echo Exiting; exit;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
else |
|
||||
echo "MD5 checksum: PASSED" |
|
||||
fi |
|
||||
if [ ! -f ut2004-lnxpatch3369-2.tar.bz2 ]; then |
|
||||
wget http://gameservermanagers.com/files/ut2004/ut2004-lnxpatch3369-2.tar.bz2 |
|
||||
else |
|
||||
echo "ut2004-lnxpatch3369-2.tar.bz2 already downloaded!" |
|
||||
fi |
|
||||
echo "Running MD5 checksum to verify the file" |
|
||||
sleep 1 |
|
||||
echo "MD5 checksum: 0fa447e05fe5a38e0e32adf171be405e" |
|
||||
md5check=$(md5sum ut2004-lnxpatch3369-2.tar.bz2|awk '{print $1;}') |
|
||||
echo "File returned: ${md5check}" |
|
||||
if [ "${md5check}" != "0fa447e05fe5a38e0e32adf171be405e" ]; then |
|
||||
echo "MD5 checksum: FAILED!" |
|
||||
read -p "Retry download? [y/N]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) rm -fv ut2004-lnxpatch3369-2.tar.bz2; install_dl_ut2k4.sh;; |
|
||||
[Nn]* ) echo Exiting; exit;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
else |
|
||||
echo "MD5 checksum: PASSED" |
|
||||
fi |
|
||||
echo "" |
|
@ -1,54 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM install_dl_ut99.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
echo "" |
|
||||
echo "Downloading Server Files" |
|
||||
echo "=================================" |
|
||||
sleep 1 |
|
||||
cd "${filesdir}" |
|
||||
if [ ! -f ut-server-436.tar.gz ]; then |
|
||||
wget http://gameservermanagers.com/files/ut99/ut-server-436.tar.gz |
|
||||
else |
|
||||
echo "ut-server-436.tar.gz already downloaded!" |
|
||||
fi |
|
||||
echo "Running MD5 checksum to verify the file" |
|
||||
sleep 1 |
|
||||
echo "MD5 checksum: 10cd7353aa9d758a075c600a6dd193fd" |
|
||||
md5check=$(md5sum ut-server-436.tar.gz|awk '{print $1;}') |
|
||||
echo "File returned: ${md5check}" |
|
||||
if [ "${md5check}" != "10cd7353aa9d758a075c600a6dd193fd" ]; then |
|
||||
echo "MD5 checksum: FAILED!" |
|
||||
read -p "Retry download? [y/N]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) rm -fv ut-server-436.tar.gz; fn_filesdl;; |
|
||||
[Nn]* ) echo Exiting; exit;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
else |
|
||||
echo "MD5 checksum: PASSED" |
|
||||
fi |
|
||||
if [ ! -f UTPGPatch451.tar.bz2 ]; then |
|
||||
wget http://gameservermanagers.com/files/ut99/UTPGPatch451.tar.bz2 |
|
||||
else |
|
||||
echo "UTPGPatch451.tar.bz2 already downloaded!" |
|
||||
fi |
|
||||
echo "Running MD5 checksum to verify the file" |
|
||||
sleep 1 |
|
||||
echo "MD5 checksum: 77a735a78b1eb819042338859900b83b" |
|
||||
md5check=$(md5sum UTPGPatch451.tar.bz2|awk '{print $1;}') |
|
||||
echo "File returned: ${md5check}" |
|
||||
if [ "${md5check}" != "77a735a78b1eb819042338859900b83b" ]; then |
|
||||
echo "MD5 checksum: FAILED!" |
|
||||
read -p "Retry download? [y/N]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) rm -fv UTPGPatch451.tar.bz2; fn_filesdl;; |
|
||||
[Nn]* ) echo Exiting; exit;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
else |
|
||||
echo "MD5 checksum: PASSED" |
|
||||
fi |
|
||||
echo "" |
|
@ -1,42 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM install_gslt.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
# Description: Configures GSLT. |
|
||||
|
|
||||
if [ -z "${autoinstall}" ]; then |
|
||||
echo "" |
|
||||
echo "Game Server Login Token" |
|
||||
echo "============================" |
|
||||
sleep 1 |
|
||||
if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then |
|
||||
echo "GSLT is required to run a public ${gamename} server" |
|
||||
else |
|
||||
echo "GSLT is an optional feature for ${gamename} server" |
|
||||
fi |
|
||||
|
|
||||
echo "Get more info and a token here:" |
|
||||
echo "http://gameservermanagers.com/gslt" |
|
||||
echo "" |
|
||||
echo "Enter token below (Can be blank)." |
|
||||
echo -n "GSLT TOKEN: " |
|
||||
read token |
|
||||
sed -i -e "s/gslt=\"\"/gslt=\"${token}\"/g" "${rootdir}/${selfname}" |
|
||||
sleep 1 |
|
||||
echo "The GSLT can be changed by editing ${selfname}." |
|
||||
echo "" |
|
||||
else |
|
||||
if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then |
|
||||
fn_printinfomationnl "GSLT is required to run a public ${gamename} server" |
|
||||
else |
|
||||
fn_printinfomationnl "GSLT is an optional feature for ${gamename} server" |
|
||||
fi |
|
||||
echo "Get more info and a token here:" |
|
||||
echo "http://gameservermanagers.com/gslt" |
|
||||
echo "" |
|
||||
sleep 1 |
|
||||
echo "The GSLT can be changed by editing ${selfname}." |
|
||||
sleep 1 |
|
||||
fi |
|
@ -1,87 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM finstall_serverfiles.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
fn_steaminstallcommand(){ |
|
||||
check.sh |
|
||||
counter="0" |
|
||||
while [ "${counter}" == "0" ]||[ "$(grep -wc 0x402 .finstall_serverfiles.sh.tmp)" -ge "1" ]||[ "$(grep -wc 0x406 .finstall_serverfiles.sh.tmp)" -ge "1" ]||[ "$(grep -wc 0x6 .finstall_serverfiles.sh.tmp)" -ge "1" ]||[ "$(grep -wc 0x106 .finstall_serverfiles.sh.tmp)" -ge "1" ]; do |
|
||||
counter=$((counter+1)) |
|
||||
cd "${rootdir}/steamcmd" |
|
||||
if [ "${counter}" -le "10" ]; then |
|
||||
# Attempt 1-4: Standard attempt |
|
||||
# Attempt 5-6: Validate attempt |
|
||||
# Attempt 7-8: Validate, delete long name dir |
|
||||
# Attempt 9-10: Validate, delete long name dir, re-download SteamCMD |
|
||||
# Attempt 11: Failure |
|
||||
|
|
||||
if [ "${counter}" -ge "2" ]; then |
|
||||
fn_printwarningnl "SteamCMD did not complete the download, retrying: Attempt ${counter}:" |
|
||||
fi |
|
||||
|
|
||||
if [ "${counter}" -ge "7" ]; then |
|
||||
echo "Removing $(find ${filesdir} -type d -print0 | grep -Ez '[^/]{30}$')" |
|
||||
find ${filesdir} -type d -print0 | grep -Ez '[^/]{30}$' | xargs -0 rm -rf |
|
||||
fi |
|
||||
if [ "${counter}" -ge "9" ]; then |
|
||||
rm -rf "${rootdir}/steamcmd" |
|
||||
check_steamcmd.sh |
|
||||
fi |
|
||||
|
|
||||
# Detects if unbuffer command is available. |
|
||||
if [ $(command -v unbuffer) ]; then |
|
||||
unbuffer=unbuffer |
|
||||
fi |
|
||||
|
|
||||
if [ "${counter}" -le "4" ]; then |
|
||||
if [ "${engine}" == "goldsource" ]; then |
|
||||
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +quit |tee .finstall_serverfiles.sh.tmp |
|
||||
else |
|
||||
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} +quit |tee .finstall_serverfiles.sh.tmp |
|
||||
fi |
|
||||
elif [ "${counter}" -ge "5" ]; then |
|
||||
if [ "${engine}" == "goldsource" ]; then |
|
||||
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" -validate +quit |tee .finstall_serverfiles.sh.tmp |
|
||||
else |
|
||||
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" ${branch} -validate +quit |tee .finstall_serverfiles.sh.tmp |
|
||||
fi |
|
||||
fi |
|
||||
elif [ "${counter}" -ge "11" ]; then |
|
||||
fn_printfailurenl "SteamCMD did not complete the download, too many retrys" |
|
||||
break |
|
||||
fi |
|
||||
|
|
||||
done |
|
||||
|
|
||||
# Goldsource servers commonly fail to download all the server files required. |
|
||||
# Validating a few of times may reduce the chance of this issue. |
|
||||
if [ "${engine}" == "goldsource" ]; then |
|
||||
counter="0" |
|
||||
while [ "${counter}" -le "4" ]; do |
|
||||
counter=$((counter+1)) |
|
||||
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" -validate +quit |tee .finstall_serverfiles.sh.tmp |
|
||||
done |
|
||||
fi |
|
||||
rm -f .finstall_serverfiles.sh.tmp |
|
||||
} |
|
||||
|
|
||||
echo "" |
|
||||
echo "Installing ${gamename} Server" |
|
||||
echo "=================================" |
|
||||
sleep 1 |
|
||||
mkdir -pv "${filesdir}" |
|
||||
fn_steaminstallcommand |
|
||||
if [ -z "${autoinstall}" ]; then |
|
||||
echo "" |
|
||||
echo "=================================" |
|
||||
while true; do |
|
||||
read -e -i "y" -p "Was the install successful? [Y/n]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) break;; |
|
||||
[Nn]* ) install_retry.sh;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
fi |
|
@ -1,42 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM install_ut2k4.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
echo "" |
|
||||
echo "Installing ${gamename} Server" |
|
||||
echo "=================================" |
|
||||
sleep 1 |
|
||||
cd "${filesdir}" |
|
||||
echo "Extracting dedicatedserver3339-bonuspack.zip" |
|
||||
sleep 1 |
|
||||
unzip dedicatedserver3339-bonuspack.zip |
|
||||
echo "Extracting ut2004-lnxpatch3369-2.tar.bz2" |
|
||||
sleep 1 |
|
||||
tar -xvjf ut2004-lnxpatch3369-2.tar.bz2 UT2004-Patch/ --strip-components=1 |
|
||||
while true; do |
|
||||
read -p "Was the install successful? [y/N]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) break;; |
|
||||
[Nn]* ) install_retry.sh;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
while true; do |
|
||||
read -p "Remove ut2004-lnxpatch3369-2.tar.bz2? [y/N]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) rm -fv ut2004-lnxpatch3369-2.tar.bz2; break;; |
|
||||
[Nn]* ) break;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
while true; do |
|
||||
read -p "Remove dedicatedserver3339-bonuspack.zip? [y/N]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) rm -fv dedicatedserver3339-bonuspack.zip; break;; |
|
||||
[Nn]* ) break;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
echo "" |
|
@ -1,19 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM install_ut2k4_key.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
echo "" |
|
||||
echo "Enter ${gamename} CD Key" |
|
||||
echo "=================================" |
|
||||
sleep 1 |
|
||||
echo "To get your server listed on the Master Server list" |
|
||||
echo "you must get a free CD key. Get a key here:" |
|
||||
echo "https://forums.unrealtournament.com/utserver/cdkey.php?2004" |
|
||||
echo "" |
|
||||
echo "Once you have the key enter it below" |
|
||||
echo -n "KEY: " |
|
||||
read CODE |
|
||||
echo ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey" |
|
||||
echo "" |
|
@ -1,42 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM install_ut99.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
echo "" |
|
||||
echo "Installing ${gamename} Server" |
|
||||
echo "=================================" |
|
||||
sleep 1 |
|
||||
cd "${filesdir}" |
|
||||
echo "Extracting ut-server-436.tar.gz" |
|
||||
sleep 1 |
|
||||
tar -zxvf ut-server-436.tar.gz ut-server/ --strip-components=1 |
|
||||
echo "Extracting UTPGPatch451.tar.bz2" |
|
||||
sleep 1 |
|
||||
tar -jxvf UTPGPatch451.tar.bz2 |
|
||||
while true; do |
|
||||
read -p "Was the install successful? [y/N]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) break;; |
|
||||
[Nn]* ) install_retry.sh;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
while true; do |
|
||||
read -p "Remove ut-server-436.tar.gz? [y/N]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) rm -fv ut-server-436.tar.gz; break;; |
|
||||
[Nn]* ) break;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
while true; do |
|
||||
read -p "Remove UTPGPatch451.tar.bz2? [y/N]" yn |
|
||||
case $yn in |
|
||||
[Yy]* ) rm -fv UTPGPatch451.tar.bz2; break;; |
|
||||
[Nn]* ) break;; |
|
||||
* ) echo "Please answer yes or no.";; |
|
||||
esac |
|
||||
done |
|
||||
echo "" |
|
@ -1,97 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM monitor_gsquery.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="271215" |
|
||||
|
|
||||
# Description: uses gsquery.py to directly query the server. |
|
||||
# Detects if the server has frozen. |
|
||||
|
|
||||
local modulename="Monitor" |
|
||||
if [ -f "${rootdir}/gsquery.py" ]; then |
|
||||
if [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then |
|
||||
gameport=$(grep Port= "${servercfgfullpath}"|grep -v Master|grep -v LAN|grep -v Proxy|grep -v Listen|tr -d '\r'|tr -cd '[:digit:]') |
|
||||
port=$((${gameport} + 1)) |
|
||||
elif [ "${engine}" == "spark" ]; then |
|
||||
port=$((${port} + 1)) |
|
||||
elif [ "${engine}" == "realvirtuality" ]; then |
|
||||
queryport=$(grep -s steamqueryport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd '[:digit:]') |
|
||||
port=${queryport} |
|
||||
elif [ "${gamename}" == "7 Days To Die" ]; then |
|
||||
gameport=$(grep ServerPort "${servercfgfullpath}"|tr -cd '[:digit:]') |
|
||||
port=$((${gameport} + 1)) |
|
||||
elif [ "${gamename}" == "Hurtworld" ]; then |
|
||||
gameport="${port}" |
|
||||
port="${queryport}" |
|
||||
fi |
|
||||
fn_printinfo "Detected gsquery.py" |
|
||||
fn_scriptlog "Detected gsquery.py" |
|
||||
sleep 1 |
|
||||
fn_printdots "Querying port: ${ip}:${port} : QUERYING" |
|
||||
fn_scriptlog "Querying port: ${ip}:${port} : QUERYING" |
|
||||
sleep 1 |
|
||||
serverquery=$("${rootdir}/gsquery.py" -a ${ip} -p ${port} -e ${engine} 2>&1) |
|
||||
exitcode=$? |
|
||||
if [ "${exitcode}" == "1" ]||[ "${exitcode}" == "2" ]||[ "${exitcode}" == "3" ]||[ "${exitcode}" == "4" ]; then |
|
||||
fn_printfail "Querying port: ${ip}:${port} : ${serverquery}" |
|
||||
fn_scriptlog "Querying port: ${ip}:${port} : ${serverquery}" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
if [ -z "${secondquery}" ]; then |
|
||||
if [ "${engine}" == "unreal2" ]; then |
|
||||
# unreal 2: Map change can take around 60 seconds |
|
||||
fn_printinfo "Waiting 60 seconds to re-query" |
|
||||
fn_scriptlog "Waiting 60 seconds to re-query" |
|
||||
sleep 60 |
|
||||
else |
|
||||
fn_printinfo "Waiting 30 seconds to re-query" |
|
||||
fn_scriptlog "Waiting 30 seconds to re-query" |
|
||||
sleep 30 |
|
||||
fi |
|
||||
secondquery=1 |
|
||||
monitor_gsquery.sh |
|
||||
fi |
|
||||
if [ "${emailnotification}" = "on" ]; then |
|
||||
info_config.sh |
|
||||
subject="${servicename} Monitor - Starting ${servername}" |
|
||||
failurereason="Failed to query ${servicename}: ${serverquery}" |
|
||||
actiontaken="restarted ${servicename}" |
|
||||
email.sh |
|
||||
fi |
|
||||
fn_restart |
|
||||
exit 1 |
|
||||
elif [ "${exitcode}" == "0" ]; then |
|
||||
fn_printok "Querying port: ${ip}:${port} : OK" |
|
||||
fn_scriptlog "Querying port: ${ip}:${port} : OK" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
exit |
|
||||
elif [ "${exitcode}" == "126" ]; then |
|
||||
fn_printfail "Querying port: ${ip}:${port} : ERROR: ${rootdir}/gsquery.py: Permission denied" |
|
||||
fn_scriptlog "Querying port: ${ip}:${port} : ERROR: ${rootdir}/gsquery.py: Permission denied" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
echo "Attempting to resolve automatically" |
|
||||
chmod +x -v "${rootdir}/gsquery.py" |
|
||||
if [ $? -eq 0 ]; then |
|
||||
monitor_gsquery.sh |
|
||||
else |
|
||||
fn_printfailure "Unable to resolve automatically. Please manually fix permissions.\n" |
|
||||
owner=$(ls -al ${rootdir}/gsquery.py|awk '{ print $3 }') |
|
||||
echo "As user ${owner} or root run the following command." |
|
||||
whoami=$(whoami) |
|
||||
echo -en "\nchown ${whoami}:${whoami} ${rootdir}/gsquery.py\n\n" |
|
||||
exit 1 |
|
||||
fi |
|
||||
else |
|
||||
fn_printfail "Querying port: ${ip}:${port} : UNKNOWN ERROR" |
|
||||
fn_scriptlog "Querying port: ${ip}:${port} : UNKNOWN ERROR" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
${rootdir}/gsquery.py -a ${ip} -p ${port} -e ${engine} |
|
||||
exit 1 |
|
||||
fi |
|
||||
else |
|
||||
fn_printfailnl "Could not find ${rootdir}/gsquery.py" |
|
||||
fn_scriptlog "Could not find ${rootdir}/gsquery.py" |
|
||||
fi |
|
@ -1,335 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM update_check.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="060216" |
|
||||
|
|
||||
# Description: Checks if a server update is available. |
|
||||
|
|
||||
local modulename="Update" |
|
||||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
||||
|
|
||||
### SteamCMD Update Checker ### |
|
||||
|
|
||||
fn_appmanifestinfo(){ |
|
||||
appmanifestfile=$(find "${filesdir}" -type f -name "appmanifest_${appid}.acf") |
|
||||
appmanifestfilewc=$(find "${filesdir}" -type f -name "appmanifest_${appid}.acf"|wc -l) |
|
||||
} |
|
||||
|
|
||||
fn_appmanifestcheck(){ |
|
||||
fn_appmanifestinfo |
|
||||
# Multiple or no matching appmanifest files may sometimes be available. |
|
||||
# This is an error is corrected below if required. |
|
||||
if [ "${appmanifestfilewc}" -ge "2" ]; then |
|
||||
sleep 1 |
|
||||
fn_printwarn "Multiple appmanifest_${appid}.acf files found" |
|
||||
fn_scriptlog "Warning! Multiple appmanifest_${appid}.acf files found" |
|
||||
sleep 2 |
|
||||
fn_printdots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files" |
|
||||
sleep 1 |
|
||||
for appfile in ${appmanifestfile}; do |
|
||||
rm "${appfile}" |
|
||||
done |
|
||||
appmanifestfilewc1="${appmanifestfilewc}" |
|
||||
fn_appmanifestinfo |
|
||||
if [ "${appmanifestfilewc}" -ge "2" ]; then |
|
||||
fn_printfail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" |
|
||||
fn_scriptlog "Failure! Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" |
|
||||
sleep 1 |
|
||||
echo "" |
|
||||
echo " Check user permissions" |
|
||||
for appfile in ${appmanifestfile}; do |
|
||||
echo " ${appfile}" |
|
||||
done |
|
||||
exit 1 |
|
||||
else |
|
||||
sleep 1 |
|
||||
fn_printok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" |
|
||||
fn_scriptlog "Success! Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" |
|
||||
sleep 1 |
|
||||
fn_printinfonl "Forcing update to correct issue" |
|
||||
fn_scriptlog "Forcing update to correct issue" |
|
||||
sleep 1 |
|
||||
update_dl.sh |
|
||||
update_check.sh |
|
||||
fi |
|
||||
elif [ "${appmanifestfilewc}" -eq "0" ]; then |
|
||||
if [ "${forceupdate}" == "1" ]; then |
|
||||
fn_printfail "Still no appmanifest_${appid}.acf found: Unable to update" |
|
||||
fn_scriptlog "Warning! Still no appmanifest_${appid}.acf found: Unable to update" |
|
||||
exit 1 |
|
||||
fi |
|
||||
forceupdate=1 |
|
||||
fn_printwarn "No appmanifest_${appid}.acf found" |
|
||||
fn_scriptlog "Warning! No appmanifest_${appid}.acf found" |
|
||||
sleep 2 |
|
||||
fn_printinfonl "Forcing update to correct issue" |
|
||||
fn_scriptlog "Forcing update to correct issue" |
|
||||
sleep 1 |
|
||||
update_dl.sh |
|
||||
update_check.sh |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_logupdaterequest(){ |
|
||||
# Checks for server update requests from server logs. |
|
||||
fn_printdots "Checking for update: Server logs" |
|
||||
fn_scriptlog "Checking for update: Server logs" |
|
||||
sleep 1 |
|
||||
requestrestart=$(grep -Ec "MasterRequestRestart" "${consolelog}") |
|
||||
if [ "${requestrestart}" -ge "1" ]; then |
|
||||
fn_printoknl "Checking for update: Server logs: Update requested" |
|
||||
sleep 1 |
|
||||
echo "" |
|
||||
echo -ne "Applying update.\r" |
|
||||
sleep 1 |
|
||||
echo -ne "Applying update..\r" |
|
||||
sleep 1 |
|
||||
echo -ne "Applying update...\r" |
|
||||
sleep 1 |
|
||||
echo -ne "\n" |
|
||||
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") |
|
||||
unset updateonstart |
|
||||
if [ "${tmuxwc}" -eq 1 ]; then |
|
||||
command_stop.sh |
|
||||
update_dl.sh |
|
||||
command_start.sh |
|
||||
else |
|
||||
update_dl.sh |
|
||||
fi |
|
||||
else |
|
||||
fn_printok "Checking for update: Server logs: No update requested" |
|
||||
sleep 1 |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
fn_steamcmdcheck(){ |
|
||||
fn_appmanifestcheck |
|
||||
# Checks for server update from SteamCMD |
|
||||
fn_printdots "Checking for update: SteamCMD" |
|
||||
fn_scriptlog "Checking for update: SteamCMD" |
|
||||
sleep 1 |
|
||||
|
|
||||
# Gets currentbuild |
|
||||
currentbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) |
|
||||
|
|
||||
# Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD |
|
||||
|
|
||||
# Gets availablebuild info |
|
||||
cd "${rootdir}/steamcmd" |
|
||||
if [ -f "${HOME}/Steam/appcache/appinfo.vdf" ]; then |
|
||||
rm -f "${HOME}/Steam/appcache/appinfo.vdf" |
|
||||
fi |
|
||||
|
|
||||
# set branch for updateinfo |
|
||||
IFS=' ' read -a branchsplits <<< "${branch}" |
|
||||
if [ "${#branchsplits[@]}" -gt 1 ]; then |
|
||||
branchname="${branchsplits[1]}" |
|
||||
else |
|
||||
branchname="public" |
|
||||
fi |
|
||||
|
|
||||
availablebuild=$(./steamcmd.sh +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +app_info_print "${appid}" +quit | grep -EA 1000 "^\s+\"branches\"$" | grep -EA 5 "^\s+\"${branchname}\"$" | grep -m 1 -EB 10 "^\s+}$" | grep -E "^\s+\"buildid\"\s+" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) |
|
||||
if [ -z "${availablebuild}" ]; then |
|
||||
fn_printfail "Checking for update: SteamCMD" |
|
||||
fn_scriptlog "Failure! Checking for update: SteamCMD" |
|
||||
sleep 1 |
|
||||
fn_printfailnl "Checking for update: SteamCMD: Not returning version info" |
|
||||
fn_scriptlog "Failure! Checking for update: SteamCMD: Not returning version info" |
|
||||
exit 1 |
|
||||
else |
|
||||
fn_printok "Checking for update: SteamCMD" |
|
||||
fn_scriptlog "Success! Checking for update: SteamCMD" |
|
||||
sleep 1 |
|
||||
fi |
|
||||
|
|
||||
if [ "${currentbuild}" != "${availablebuild}" ]; then |
|
||||
echo -e "\n" |
|
||||
echo -e "Update available:" |
|
||||
sleep 1 |
|
||||
echo -e " Current build: \e[0;31m${currentbuild}\e[0;39m" |
|
||||
echo -e " Available build: \e[0;32m${availablebuild}\e[0;39m" |
|
||||
echo -e "" |
|
||||
echo -e " https://steamdb.info/app/${appid}/" |
|
||||
sleep 1 |
|
||||
echo "" |
|
||||
echo -en "Applying update.\r" |
|
||||
sleep 1 |
|
||||
echo -en "Applying update..\r" |
|
||||
sleep 1 |
|
||||
echo -en "Applying update...\r" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
fn_scriptlog "Update available" |
|
||||
fn_scriptlog "Current build: ${currentbuild}" |
|
||||
fn_scriptlog "Available build: ${availablebuild}" |
|
||||
fn_scriptlog "${currentbuild} > ${availablebuild}" |
|
||||
|
|
||||
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") |
|
||||
unset updateonstart |
|
||||
if [ "${tmuxwc}" -eq 1 ]; then |
|
||||
command_stop.sh |
|
||||
update_dl.sh |
|
||||
command_start.sh |
|
||||
else |
|
||||
update_dl.sh |
|
||||
fi |
|
||||
else |
|
||||
echo -e "\n" |
|
||||
echo -e "No update available:" |
|
||||
echo -e " Current version: \e[0;32m${currentbuild}\e[0;39m" |
|
||||
echo -e " Available version: \e[0;32m${availablebuild}\e[0;39m" |
|
||||
echo -e " https://steamdb.info/app/${appid}/" |
|
||||
echo -e "" |
|
||||
fn_printoknl "No update available" |
|
||||
fn_scriptlog "Current build: ${currentbuild}" |
|
||||
fn_scriptlog "Available build: ${availablebuild}" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
### END SteamCMD Update Checker ### |
|
||||
|
|
||||
fn_teamspeak3_check(){ |
|
||||
# Checks for server update from teamspeak.com using a mirror dl.4players.de |
|
||||
fn_printdots "Checking for update: teamspeak.com" |
|
||||
fn_scriptlog "Checking for update: teamspeak.com" |
|
||||
sleep 1 |
|
||||
|
|
||||
# Gets currentbuild info |
|
||||
# Checks currentbuild info is available, if fails a server restart will be forced to generate logs |
|
||||
if [ -z "$(find ./* -name 'ts3server*_0.log')" ]; then |
|
||||
fn_printfail "Checking for update: teamspeak.com" |
|
||||
sleep 1 |
|
||||
fn_printfailnl "Checking for update: teamspeak.com: No logs with server version found" |
|
||||
fn_scriptlog "Failure! Checking for update: teamspeak.com: No logs with server version found" |
|
||||
sleep 2 |
|
||||
fn_printinfonl "Checking for update: teamspeak.com: Forcing server restart" |
|
||||
fn_scriptlog "Checking for update: teamspeak.com: Forcing server restart" |
|
||||
sleep 2 |
|
||||
command_stop.sh |
|
||||
command_start.sh |
|
||||
sleep 2 |
|
||||
# If still failing will exit |
|
||||
if [ -z "$(find ./* -name 'ts3server*_0.log')" ]; then |
|
||||
fn_printfailnl "Checking for update: teamspeak.com: Still No logs with server version found" |
|
||||
fn_scriptlog "Failure! Checking for update: teamspeak.com: Still No logs with server version found" |
|
||||
exit 1 |
|
||||
fi |
|
||||
fi |
|
||||
currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${rootdir}/.ts3version' | tail -1) | egrep -o 'TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}' | egrep -o '((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}') |
|
||||
|
|
||||
# Gets the teamspeak server architecture |
|
||||
info_distro.sh |
|
||||
if [ "${arch}" == "x86_64" ]; then |
|
||||
ts3arch="amd64" |
|
||||
elif [ "${arch}" == "i386" ]||[ "${arch}" == "i686" ]; then |
|
||||
ts3arch="x86" |
|
||||
else |
|
||||
echo "" |
|
||||
fn_printfailure "${arch} is an unsupported architecture" |
|
||||
exit 1 |
|
||||
fi |
|
||||
|
|
||||
# Gets availablebuild info |
|
||||
|
|
||||
# Grabs all version numbers but not in correct order |
|
||||
wget "http://dl.4players.de/ts/releases/?C=M;O=D" -q -O -| grep -i dir | egrep -o '<a href=\".*\/\">.*\/<\/a>' | egrep -o '[0-9\.?]+'|uniq > .ts3_version_numbers_unsorted.tmp |
|
||||
|
|
||||
# Sort version numbers |
|
||||
cat .ts3_version_numbers_unsorted.tmp | sort -r --version-sort -o .ts3_version_numbers_sorted.tmp |
|
||||
|
|
||||
# Finds directory with most recent server version. |
|
||||
while read ts3_version_number; do |
|
||||
wget --spider -q "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" |
|
||||
if [ $? -eq 0 ]; then |
|
||||
availablebuild="${ts3_version_number}" |
|
||||
# Break while-loop, if the latest release could be found |
|
||||
break |
|
||||
fi |
|
||||
done < .ts3_version_numbers_sorted.tmp |
|
||||
|
|
||||
# Tidy up |
|
||||
rm -f ".ts3_version_numbers_unsorted.tmp" |
|
||||
rm -f ".ts3_version_numbers_sorted.tmp" |
|
||||
|
|
||||
# Checks availablebuild info is available |
|
||||
if [ -z "${availablebuild}" ]; then |
|
||||
fn_printfail "Checking for update: teamspeak.com" |
|
||||
fn_scriptlog "Checking for update: teamspeak.com" |
|
||||
sleep 1 |
|
||||
fn_printfail "Checking for update: teamspeak.com: Not returning version info" |
|
||||
fn_scriptlog "Failure! Checking for update: teamspeak.com: Not returning version info" |
|
||||
sleep 2 |
|
||||
exit 1 |
|
||||
else |
|
||||
fn_printok "Checking for update: teamspeak.com" |
|
||||
fn_scriptlog "Success! Checking for update: teamspeak.com" |
|
||||
sleep 1 |
|
||||
fi |
|
||||
|
|
||||
# Removes dots so if can compare version numbers |
|
||||
currentbuilddigit=$(echo "${currentbuild}"|tr -cd '[:digit:]') |
|
||||
availablebuilddigit=$(echo "${availablebuild}"|tr -cd '[:digit:]') |
|
||||
if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then |
|
||||
echo -e "\n" |
|
||||
echo -e "Update available:" |
|
||||
sleep 1 |
|
||||
echo -e " Current build: \e[0;31m${currentbuild} ${architecture}\e[0;39m" |
|
||||
echo -e " Available build: \e[0;32m${availablebuild} ${architecture}\e[0;39m" |
|
||||
echo -e "" |
|
||||
sleep 1 |
|
||||
echo "" |
|
||||
echo -en "Applying update.\r" |
|
||||
sleep 1 |
|
||||
echo -en "Applying update..\r" |
|
||||
sleep 1 |
|
||||
echo -en "Applying update...\r" |
|
||||
sleep 1 |
|
||||
echo -en "\n" |
|
||||
fn_scriptlog "Update available" |
|
||||
fn_scriptlog "Current build: ${currentbuild}" |
|
||||
fn_scriptlog "Available build: ${availablebuild}" |
|
||||
fn_scriptlog "${currentbuild} > ${availablebuild}" |
|
||||
unset updateonstart |
|
||||
info_ts3status.sh |
|
||||
if [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then |
|
||||
update_dl.sh |
|
||||
command_start.sh |
|
||||
sleep 5 |
|
||||
command_stop.sh |
|
||||
else |
|
||||
command_stop.sh |
|
||||
update_dl.sh |
|
||||
command_start.sh |
|
||||
fi |
|
||||
else |
|
||||
echo -e "\n" |
|
||||
echo -e "No update available:" |
|
||||
echo -e " Current version: \e[0;32m${currentbuild}\e[0;39m" |
|
||||
echo -e " Available version: \e[0;32m${availablebuild}\e[0;39m" |
|
||||
echo -e "" |
|
||||
fn_printoknl "No update available" |
|
||||
fn_scriptlog "Current build: ${currentbuild}" |
|
||||
fn_scriptlog "Available build: ${availablebuild}" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
check.sh |
|
||||
fn_printdots "Checking for update" |
|
||||
if [ "${gamename}" == "Teamspeak 3" ]; then |
|
||||
fn_teamspeak3_check |
|
||||
elif [ "${engine}" == "goldsource" ]||[ "${forceupdate}" == "1" ]; then |
|
||||
# Goldsource servers bypass checks as fn_steamcmdcheck does not work for appid 90 servers. |
|
||||
# forceupdate bypasses checks |
|
||||
tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:") |
|
||||
if [ "${tmuxwc}" -eq 1 ]; then |
|
||||
command_stop.sh |
|
||||
update_dl.sh |
|
||||
command_start.sh |
|
||||
else |
|
||||
update_dl.sh |
|
||||
fi |
|
||||
else |
|
||||
fn_logupdaterequest |
|
||||
fn_steamcmdcheck |
|
||||
fi |
|
@ -1,83 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM update_dl.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="020216" |
|
||||
|
|
||||
# Description: Runs a server update. |
|
||||
|
|
||||
local modulename="Update" |
|
||||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
||||
|
|
||||
fn_steamcmd_dl(){ |
|
||||
cd "${rootdir}" |
|
||||
cd "steamcmd" |
|
||||
|
|
||||
# Detects if unbuffer command is available. |
|
||||
if [ $(command -v unbuffer) ]; then |
|
||||
unbuffer=unbuffer |
|
||||
fi |
|
||||
|
|
||||
if [ "${engine}" == "goldsource" ]; then |
|
||||
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +quit|tee -a "${scriptlog}" |
|
||||
else |
|
||||
${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" +quit|tee -a "${scriptlog}" |
|
||||
fi |
|
||||
|
|
||||
fix.sh |
|
||||
} |
|
||||
|
|
||||
fn_teamspeak3_dl(){ |
|
||||
cd "${rootdir}" |
|
||||
echo -e "downloading teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2...\c" |
|
||||
fn_scriptlog "Downloading teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" |
|
||||
wget -N /dev/null http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2 2>&1 | grep -F HTTP | cut -c45-| uniq |
|
||||
sleep 1 |
|
||||
echo -e "extracting teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2...\c" |
|
||||
fn_scriptlog "Extracting teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" |
|
||||
tar -xf "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" 2> "${scriptlogdir}/.${servicename}-tar-error.tmp" |
|
||||
local status=$? |
|
||||
if [ ${status} -eq 0 ]; then |
|
||||
echo "OK" |
|
||||
else |
|
||||
echo "FAIL - Exit status ${status}" |
|
||||
fn_scriptlog "Failed to extract - Exit status ${status}" |
|
||||
sleep 1 |
|
||||
cat "${scriptlogdir}/.${servicename}-tar-error.tmp" |
|
||||
cat "${scriptlogdir}/.${servicename}-tar-error.tmp" >> "${scriptlog}" |
|
||||
rm "${scriptlogdir}/.${servicename}-tar-error.tmp" |
|
||||
fn_scriptlog "Failure! Unable to update" |
|
||||
exit ${status} |
|
||||
fi |
|
||||
echo -e "copying to ${filesdir}...\c" |
|
||||
fn_scriptlog "Copying to ${filesdir}" |
|
||||
cp -R "${rootdir}/teamspeak3-server_linux_${ts3arch}/"* "${filesdir}" 2> "${scriptlogdir}/.${servicename}-cp-error.tmp" |
|
||||
local status=$? |
|
||||
if [ ${status} -eq 0 ]; then |
|
||||
echo "OK" |
|
||||
else |
|
||||
echo "FAIL - Exit status ${status}" |
|
||||
fn_scriptlog "Failed to copy - Exit status ${status}" |
|
||||
sleep 1 |
|
||||
cat "${scriptlogdir}/.${servicename}-cp-error.tmp" |
|
||||
cat "${scriptlogdir}/.${servicename}-cp-error.tmp" >> "${scriptlog}" |
|
||||
rm "${scriptlogdir}/.${servicename}-cp-error.tmp" |
|
||||
fn_scriptlog "Failure! Unable to update" |
|
||||
exit ${status} |
|
||||
fi |
|
||||
rm -f teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2 |
|
||||
rm -rf "${rootdir}/teamspeak3-server_linux_${ts3arch}" |
|
||||
} |
|
||||
|
|
||||
check.sh |
|
||||
info_config.sh |
|
||||
fn_printdots "Updating ${servername}" |
|
||||
sleep 1 |
|
||||
fn_printoknl "Updating ${servername}" |
|
||||
fn_scriptlog "Updating ${servername}" |
|
||||
sleep 1 |
|
||||
if [ "${gamename}" == "Teamspeak 3" ]; then |
|
||||
fn_teamspeak3_dl |
|
||||
else |
|
||||
fn_steamcmd_dl |
|
||||
fi |
|
@ -1,24 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
# LGSM update_functions.sh function |
|
||||
# Author: Daniel Gibbs |
|
||||
# Website: http://gameservermanagers.com |
|
||||
lgsm_version="230116" |
|
||||
|
|
||||
# Description: Deletes the functions dir to allow re-downloading of functions from GitHub. |
|
||||
|
|
||||
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
|
||||
check.sh |
|
||||
fn_printdots "Updating functions" |
|
||||
fn_scriptlog "Updating functions" |
|
||||
sleep 1 |
|
||||
echo -ne "\n" |
|
||||
rm -rfv "${rootdir}/functions/"* |
|
||||
exitcode=$? |
|
||||
if [ "${exitcode}" == "0" ]; then |
|
||||
fn_printok "Updating functions" |
|
||||
fn_scriptlog "Success! Updating functions" |
|
||||
else |
|
||||
fn_printfail "Updating functions" |
|
||||
fn_scriptlog "Failure! Updating functions" |
|
||||
fi |
|
||||
echo -ne "\n" |
|
@ -0,0 +1,61 @@ |
|||||
|
#!/bin/bash |
||||
|
# LGSM alert.sh function |
||||
|
# Author: Daniel Gibbs |
||||
|
# Website: https://gameservermanagers.com |
||||
|
lgsm_version="210516" |
||||
|
|
||||
|
# Description: Overall function for managing alerts. |
||||
|
|
||||
|
fn_alert_test(){ |
||||
|
fn_scriptlog "Sending test alert" |
||||
|
alertsubject="LGSM - Alert Check - ${servername}" |
||||
|
alertbody="LGSM test alert, how you read?" |
||||
|
} |
||||
|
|
||||
|
fn_alert_restart(){ |
||||
|
fn_scriptlog "Sending restart alert: ${executable} process not running" |
||||
|
alertsubject="LGSM - Restarted - ${servername}" |
||||
|
alertbody="${servicename} ${executable} process not running" |
||||
|
} |
||||
|
|
||||
|
fn_alert_restart_query(){ |
||||
|
fn_scriptlog "Sending restart alert: ${gsquerycmd}" |
||||
|
alertsubject="LGSM - Restarted - ${servername}" |
||||
|
alertbody="Failed to Query: ${gsquerycmd}" |
||||
|
} |
||||
|
|
||||
|
fn_alert_update(){ |
||||
|
fn_scriptlog "Sending update alert" |
||||
|
alertsubject="LGSM - Updated - ${servername}" |
||||
|
alertbody="${servicename} Recieved update" |
||||
|
} |
||||
|
|
||||
|
if [ "${alert}" == "restart" ]; then |
||||
|
fn_alert_restart |
||||
|
elif [ "${alert}" == "restartquery" ]; then |
||||
|
fn_alert_restart_query |
||||
|
elif [ "${alert}" == "update" ]; then |
||||
|
fn_alert_update |
||||
|
elif [ "${alert}" == "test" ]; then |
||||
|
fn_alert_test |
||||
|
fi |
||||
|
|
||||
|
if [ "${emailnotification}" == "on" ]||[ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then |
||||
|
alert_email.sh |
||||
|
elif [ "${emailnotification}" != "on" ]||[ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then |
||||
|
fn_print_fail_nl "Alerts not enabled" |
||||
|
fn_scriptlog "Email alerts not enabled" |
||||
|
elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then |
||||
|
fn_print_fail_nl "Email no set" |
||||
|
fn_scriptlog "Email no set" |
||||
|
fi |
||||
|
|
||||
|
if [ "${pushbulletalert}" == "on" ]&&[ -n "${pushbullettoken}" ]; then |
||||
|
alert_pushbullet.sh |
||||
|
elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then |
||||
|
fn_print_fail_nl "Pushbullet alerts not enabled" |
||||
|
fn_scriptlog "Pushbullet alerts not enabled" |
||||
|
elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then |
||||
|
fn_print_fail_nl "Pushbullet token not set" |
||||
|
fn_scriptlog "Pushbullet token not set" |
||||
|
fi |
@ -0,0 +1,241 @@ |
|||||
|
#!/bin/bash |
||||
|
# LGSM email.sh function |
||||
|
# Author: Daniel Gibbs |
||||
|
# Website: https://gameservermanagers.com |
||||
|
lgsm_version="210516" |
||||
|
|
||||
|
# Description: Sends email alert if monitor picks up a failure. |
||||
|
|
||||
|
local modulename="Alert" |
||||
|
|
||||
|
|
||||
|
fn_details_email(){ |
||||
|
# |
||||
|
# Failure reason: Testing bb2-server email alert |
||||
|
# Action Taken: Sent test email...hello is this thing on? |
||||
|
|
||||
|
echo -e "${alertbody}" >> "${emaillog}" |
||||
|
} |
||||
|
|
||||
|
|
||||
|
fn_details_os(){ |
||||
|
# |
||||
|
# Distro Details |
||||
|
# ===================================== |
||||
|
# Distro: Ubuntu 14.04.4 LTS |
||||
|
# Arch: x86_64 |
||||
|
# Kernel: 3.13.0-79-generic |
||||
|
# Hostname: hostname |
||||
|
# tmux: tmux 1.8 |
||||
|
# GLIBC: 2.19 |
||||
|
|
||||
|
{ |
||||
|
echo -e "" |
||||
|
echo -e "Distro Details" |
||||
|
echo -e "=================================" |
||||
|
echo -e "Distro: ${os}" |
||||
|
echo -e "Arch: ${arch}" |
||||
|
echo -e "Kernel: ${kernel}" |
||||
|
echo -e "Hostname: $HOSTNAME" |
||||
|
echo -e "tmux: ${tmuxv}" |
||||
|
echo -e "GLIBC: ${glibcversion}" |
||||
|
} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 |
||||
|
} |
||||
|
|
||||
|
fn_details_performance(){ |
||||
|
# |
||||
|
# Performance |
||||
|
# ===================================== |
||||
|
# Uptime: 55d, 3h, 38m |
||||
|
# Avg Load: 1.00, 1.01, 0.78 |
||||
|
# |
||||
|
# Mem: total used free |
||||
|
# Physical: 741M 656M 85M |
||||
|
# Swap: 0B 0B 0B |
||||
|
|
||||
|
{ |
||||
|
echo -e "" |
||||
|
echo -e "Performance" |
||||
|
echo -e "=================================" |
||||
|
echo -e "Uptime: ${days}d, ${hours}h, ${minutes}m" |
||||
|
echo -e "Avg Load: ${load}" |
||||
|
echo -e "" |
||||
|
echo -e "Mem: total used free" |
||||
|
echo -e "Physical: ${physmemtotal} ${physmemused} ${physmemfree}" |
||||
|
echo -e "Swap: ${swaptotal} ${swapused} ${swapfree}" |
||||
|
} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 |
||||
|
} |
||||
|
|
||||
|
fn_details_disk(){ |
||||
|
# |
||||
|
# Storage |
||||
|
# ===================================== |
||||
|
# Filesystem: /dev/disk/by-uuid/320c8edd-a2ce-4a23-8c9d-e00a7af2d6ff |
||||
|
# Total: 15G |
||||
|
# Used: 8.4G |
||||
|
# Available: 5.7G |
||||
|
# Serverfiles: 961M |
||||
|
|
||||
|
{ |
||||
|
echo -e "" |
||||
|
echo -e "Storage" |
||||
|
echo -e "=================================" |
||||
|
echo -e "Filesystem: ${filesystem}" |
||||
|
echo -e "Total: ${totalspace}" |
||||
|
echo -e "Used: ${usedspace}" |
||||
|
echo -e "Available: ${availspace}" |
||||
|
echo -e "Serverfiles: ${filesdirdu}" |
||||
|
if [ -d "${backupdir}" ]; then |
||||
|
echo -e "Backups: ${backupdirdu}" |
||||
|
fi |
||||
|
} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
fn_details_gameserver(){ |
||||
|
# |
||||
|
# Quake Live Server Details |
||||
|
# ===================================== |
||||
|
# Server name: ql-server |
||||
|
# Server IP: 1.2.3.4:27960 |
||||
|
# RCON password: CHANGE_ME |
||||
|
# Server password: NOT SET |
||||
|
# Slots: 16 |
||||
|
# Status: OFFLINE |
||||
|
|
||||
|
{ |
||||
|
echo -e "" |
||||
|
echo -e "${gamename} Server Details" |
||||
|
echo -e "=================================" |
||||
|
# Server name |
||||
|
echo -e "Server name: ${servername}" |
||||
|
|
||||
|
# Server ip |
||||
|
echo -e "Server IP: ${ip}:${port}" |
||||
|
|
||||
|
# Server password |
||||
|
if [ -n "${serverpassword}" ]; then |
||||
|
echo -e "Server password: ********" |
||||
|
fi |
||||
|
|
||||
|
# RCON password |
||||
|
if [ -n "${rconpassword}" ]; then |
||||
|
echo -e "RCON password: ********" |
||||
|
fi |
||||
|
|
||||
|
# Admin password |
||||
|
if [ -n "${adminpassword}" ]; then |
||||
|
echo -e "Admin password: ********" |
||||
|
fi |
||||
|
|
||||
|
# Stats password (Quake Live) |
||||
|
if [ -n "${statspassword}" ]; then |
||||
|
echo -e "Stats password: ********" |
||||
|
fi |
||||
|
|
||||
|
# Slots |
||||
|
if [ -n "${slots}" ]; then |
||||
|
echo -e "Slots: ${slots}" |
||||
|
fi |
||||
|
|
||||
|
# Game mode |
||||
|
if [ -n "${gamemode}" ]; then |
||||
|
echo -e "Game mode: ${gamemode}" |
||||
|
fi |
||||
|
|
||||
|
# Game world |
||||
|
if [ -n "${gameworld}" ]; then |
||||
|
echo -e "Game world: ${gameworld}" |
||||
|
fi |
||||
|
|
||||
|
# Tick rate |
||||
|
if [ -n "${tickrate}" ]; then |
||||
|
echo -e "Tick rate: ${tickrate}" |
||||
|
fi |
||||
|
|
||||
|
# Teamspeak dbplugin |
||||
|
if [ -n "${dbplugin}" ]; then |
||||
|
echo -e "dbplugin: ${dbplugin}" |
||||
|
fi |
||||
|
|
||||
|
# Online status |
||||
|
if [ "${status}" == "0" ]; then |
||||
|
echo -e "Status: OFFLINE" |
||||
|
else |
||||
|
echo -e "Status: ONLINE" |
||||
|
fi |
||||
|
} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 |
||||
|
} |
||||
|
|
||||
|
fn_alert_email_template_logs(){ |
||||
|
{ |
||||
|
echo -e "" |
||||
|
echo -e "${servicename} Logs" |
||||
|
echo -e "=================================" |
||||
|
|
||||
|
if [ -n "${scriptlog}" ]; then |
||||
|
echo -e "\nScript log\n===================" |
||||
|
if [ ! "$(ls -A ${scriptlogdir})" ]; then |
||||
|
echo "${scriptlogdir} (NO LOG FILES)" |
||||
|
elif [ ! -s "${scriptlog}" ]; then |
||||
|
echo "${scriptlog} (LOG FILE IS EMPTY)" |
||||
|
else |
||||
|
echo "${scriptlog}" |
||||
|
tail -25 "${scriptlog}" |
||||
|
fi |
||||
|
echo "" |
||||
|
fi |
||||
|
|
||||
|
if [ -n "${consolelog}" ]; then |
||||
|
echo -e "\nConsole log\n====================" |
||||
|
if [ ! "$(ls -A ${consolelogdir})" ]; then |
||||
|
echo "${consolelogdir} (NO LOG FILES)" |
||||
|
elif [ ! -s "${consolelog}" ]; then |
||||
|
echo "${consolelog} (LOG FILE IS EMPTY)" |
||||
|
else |
||||
|
echo "${consolelog}" |
||||
|
tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }' |
||||
|
fi |
||||
|
echo "" |
||||
|
fi |
||||
|
|
||||
|
if [ -n "${gamelogdir}" ]; then |
||||
|
echo -e "\nServer log\n===================" |
||||
|
if [ ! "$(ls -A ${gamelogdir})" ]; then |
||||
|
echo "${gamelogdir} (NO LOG FILES)" |
||||
|
else |
||||
|
echo "${gamelogdir}" |
||||
|
tail "${gamelogdir}"/* | grep -v "==>" | sed '/^$/d' | tail -25 |
||||
|
fi |
||||
|
echo "" |
||||
|
fi |
||||
|
|
||||
|
} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 |
||||
|
} |
||||
|
|
||||
|
fn_print_dots "Sending alert to ${email}" |
||||
|
info_distro.sh |
||||
|
info_config.sh |
||||
|
info_glibc.sh |
||||
|
check_ip.sh |
||||
|
|
||||
|
emaillog="${emaillog}" |
||||
|
if [ -f "${emaillog}" ]; then |
||||
|
rm "${emaillog}" |
||||
|
fi |
||||
|
fn_details_email |
||||
|
fn_details_os |
||||
|
fn_details_performance |
||||
|
fn_details_disk |
||||
|
fn_details_gameserver |
||||
|
fn_alert_email_template_logs |
||||
|
mail -s "${alertsubject}" "${email}" < "${emaillog}" |
||||
|
exitcode=$? |
||||
|
if [ "${exitcode}" == "0" ]; then |
||||
|
fn_print_ok_nl "Sending alert to ${email}" |
||||
|
fn_scriptlog "Success! Sending alert to ${email}" |
||||
|
else |
||||
|
fn_print_fail_nl "Sending alert to ${email}" |
||||
|
fn_scriptlog "Failure! Sending alert to ${email}" |
||||
|
fi |
@ -0,0 +1,22 @@ |
|||||
|
#!/bin/bash |
||||
|
# LGSM alert_pushbullet.sh function |
||||
|
# Author: Daniel Gibbs |
||||
|
# Website: https://gameservermanagers.com |
||||
|
lgsm_version="210516" |
||||
|
|
||||
|
# Description: alerts using pushbullet. |
||||
|
|
||||
|
local modulename="Alert" |
||||
|
function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
|
fn_print_dots "Sending Pushbullet alert" |
||||
|
sleep 1 |
||||
|
|
||||
|
pushbulletsend=$(curl --silent -u """${pushbullettoken}"":" -d type="note" -d body="${alertbody}" -d title="${alertsubject}" 'https://api.pushbullet.com/v2/pushes'|grep -o invalid_access_token|uniq) |
||||
|
|
||||
|
if [ "${pushbulletsend}" == "invalid_access_token" ]; then |
||||
|
fn_print_fail_nl "Sending Pushbullet alert: invalid_access_token" |
||||
|
fn_scriptlog "Failure! Sending Pushbullet alert: invalid_access_token" |
||||
|
else |
||||
|
fn_print_ok_nl "Sending Pushbullet alert" |
||||
|
fn_scriptlog "Complete! Sent Pushbullet alert" |
||||
|
fi |
@ -1,14 +1,14 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
# LGSM check_config.sh function |
# LGSM check_config.sh function |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
lgsm_version="060116" |
lgsm_version="210516" |
||||
|
|
||||
# Description: If server config missing warn user. |
# Description: If server config missing warn user. |
||||
|
|
||||
if [ ! -e "${servercfgfullpath}" ]; then |
if [ ! -e "${servercfgfullpath}" ]; then |
||||
if [ "${gamename}" != "Hurtworld" ]; then |
if [ "${gamename}" != "Hurtworld" ]; then |
||||
fn_printwarnnl "Config file missing!" |
fn_print_warn_nl "Config file missing!" |
||||
echo "${servercfgfullpath}" |
echo "${servercfgfullpath}" |
||||
fn_scriptlog "Configuration file missing!" |
fn_scriptlog "Configuration file missing!" |
||||
fn_scriptlog "${servercfgfullpath}" |
fn_scriptlog "${servercfgfullpath}" |
@ -0,0 +1,35 @@ |
|||||
|
#!/bin/bash |
||||
|
# LGSM check_glibc.sh function |
||||
|
# Author: Daniel Gibbs |
||||
|
# Website: https://gameservermanagers.com |
||||
|
lgsm_version="210516" |
||||
|
|
||||
|
# Description: Checks if server has correct glibc or has a fix available. |
||||
|
|
||||
|
info_glibc.sh |
||||
|
info_distro.sh |
||||
|
|
||||
|
if [ "${glibcrequired}" == "NOT REQUIRED" ]; then |
||||
|
: |
||||
|
elif [ "${glibcrequired}" == "UNKNOWN" ]; then |
||||
|
fn_print_info_nl "Glibc fix: \e[0;31m${glibcrequired}\e[0m" |
||||
|
echo -e " * glibc required: \e[0;31m${glibcrequired}\e[0m" |
||||
|
echo -e " * glibc installed: ${glibcversion}" |
||||
|
elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then |
||||
|
if [ "${glibcfix}" == "yes" ]; then |
||||
|
if [ "${function_selfname}" != "command_install.sh" ]; then |
||||
|
fn_print_info_nl "Glibc fix: \e[0;32mUsing Glibc fix\e[0m" |
||||
|
echo -e " * glibc required: \e[0;31m${glibcrequired}\e[0m" |
||||
|
echo -e " * glibc installed: ${glibcversion}" |
||||
|
fix_glibc.sh |
||||
|
fi |
||||
|
else |
||||
|
fn_print_warn_nl "Glibc fix: \e[0;31mNo Glibc fix available!\e[0m" |
||||
|
echo -en "\n" |
||||
|
echo -e " * glibc required: ${glibcrequired}" |
||||
|
echo -e " * glibc installed: \e[0;31m${glibcversion}\e[0m" |
||||
|
echo -en "\n" |
||||
|
fn_print_infomation "The game server will probably not work. A distro upgrade is required!" |
||||
|
sleep 5 |
||||
|
fi |
||||
|
fi |
@ -1,17 +1,16 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
# LGSM check_logs.sh function |
# LGSM check_logs.sh function |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
lgsm_version="271215" |
lgsm_version="210516" |
||||
|
|
||||
# Description: Checks that log files exist on server start |
# Description: Checks that log files exist on server start |
||||
|
|
||||
# Create dir's for the script and console logs |
# Create dir's for the script and console logs |
||||
if [ ! -d "${scriptlogdir}" ]; then |
if [ ! -d "${scriptlogdir}" ]; then |
||||
fn_printdots "Checking for log files" |
fn_print_dots "Checking for log files" |
||||
sleep 1 |
sleep 1 |
||||
fn_printinfo "Checking for log files: Creating log files" |
fn_print_info_nl "Checking for log files: Creating log files" |
||||
echo -en "\n" |
|
||||
checklogs=1 |
checklogs=1 |
||||
install_logs.sh |
install_logs.sh |
||||
fi |
fi |
@ -0,0 +1,99 @@ |
|||||
|
#!/bin/bash |
||||
|
# LGSM check_permissions.sh |
||||
|
# Author: Daniel Gibbs |
||||
|
# Contributor: UltimateByte |
||||
|
# Website: https://gameservermanagers.com |
||||
|
lgsm_version="210516" |
||||
|
|
||||
|
# Description: Checks script, files and folders ownership and permissions. |
||||
|
|
||||
|
# Useful variables |
||||
|
currentuser="$(whoami)" |
||||
|
currentgroups="$(groups)" |
||||
|
scriptfullpath="${rootdir}/${selfname}" |
||||
|
conclusionpermissionerror="0" |
||||
|
|
||||
|
fn_check_ownership(){ |
||||
|
# Check script ownership |
||||
|
if [ ! -O "${scriptfullpath}" ] && [ ! -G "${scriptfullpath}" ]; then |
||||
|
fn_print_fail_nl "Oops ! Ownership issue..." |
||||
|
echo " * Current - ${currentuser} - user or its group(s) - ${currentgroups} - does not own \"${selfname}\"" |
||||
|
echo " * To check the owner and allowed groups, run ls -l \"${selfname}\"" |
||||
|
exit 1 |
||||
|
fi |
||||
|
|
||||
|
# Check rootdir ownership |
||||
|
if [ ! -O "${rootdir}" ] && [ ! -G "${rootdir}" ]; then |
||||
|
fn_print_fail_nl "Oops ! Ownership issue..." |
||||
|
echo " * Current - ${currentuser} - user or its group(s) - ${currentgroups} - does not own \"${rootdir}\"" |
||||
|
echo " * To check the owner and allowed groups, run ls -dl \"${rootdir}\"" |
||||
|
exit 1 |
||||
|
fi |
||||
|
|
||||
|
# Check functions ownership |
||||
|
funownfail="0" |
||||
|
if [ -n "${functionsdir}" ]; then |
||||
|
while read -r filename |
||||
|
do |
||||
|
if [ ! -O "${filename}" ] && [ ! -G "${filename}" ]; then |
||||
|
funownfail="1" |
||||
|
conclusionpermissionerror="1" |
||||
|
fi |
||||
|
done <<< "$(find "${functionsdir}" -name "*.sh")" |
||||
|
|
||||
|
if [ "${funownfail}" == "1" ]; then |
||||
|
fn_print_fail_nl "Oops ! Ownership issue..." |
||||
|
echo " * Current - ${currentuser} - user or its group(s) - ${currentgroups} - does not own all scripts in \"${functionsdir}\"" |
||||
|
echo " * To check the owner and allowed groups, run ls -l \"${functionsdir}\"" |
||||
|
fi |
||||
|
fi |
||||
|
} |
||||
|
|
||||
|
fn_check_permissions(){ |
||||
|
# Check rootdir permissions |
||||
|
if [ -n "${rootdir}" ]; then |
||||
|
# Get permission numbers on folder under the form 775 |
||||
|
rootdirperm="$(stat -c %a "${rootdir}")" |
||||
|
# Grab the first and second digit for user and group permission |
||||
|
userrootdirperm="${rootdirperm:0:1}" |
||||
|
grouprootdirperm="${rootdirperm:1:1}" |
||||
|
if [ "${userrootdirperm}" != "7" ] && [ "${grouprootdirperm}" != "7" ]; then |
||||
|
fn_print_fail_nl "Oops ! Permission issue..." |
||||
|
echo " * Current - ${currentuser} - user or its group(s) - ${currentgroups} need full control of \"${rootdir}\"" |
||||
|
echo " * You might wanna run : chmod -R 770 \"${rootdir}\"" |
||||
|
conclusionpermissionerror="1" |
||||
|
fi |
||||
|
fi |
||||
|
|
||||
|
# Check functions permissions |
||||
|
funcpermfail="0" |
||||
|
if [ -n "${functionsdir}" ]; then |
||||
|
while read -r filename |
||||
|
do |
||||
|
funcperm="$(stat -c %a "${filename}")" |
||||
|
userfuncdirperm="${funcperm:0:1}" |
||||
|
groupfuncdirperm="${funcperm:1:1}" |
||||
|
if [ "${userfuncdirperm}" != "7" ] && [ "${groupfuncdirperm}" != "7" ]; then |
||||
|
funcpermfail="1" |
||||
|
conclusionpermissionerror="1" |
||||
|
fi |
||||
|
done <<< "$(find "${functionsdir}" -name "*.sh")" |
||||
|
|
||||
|
if [ "${funcpermfail}" == "1" ]; then |
||||
|
fn_print_fail_nl "Oops ! Permission issue..." |
||||
|
echo " * Current - ${currentuser} - user or its group(s) - ${currentgroups} need full control on scripts in \"${functionsdir}\"" |
||||
|
echo " * You might wanna run : chmod -R 770 \"${functionsdir}\"" |
||||
|
fi |
||||
|
fi |
||||
|
} |
||||
|
|
||||
|
fn_check_permissions_conclusion(){ |
||||
|
# Exit if errors found |
||||
|
if [ "${conclusionpermissionerror}" == "1" ]; then |
||||
|
exit 1 |
||||
|
fi |
||||
|
} |
||||
|
|
||||
|
fn_check_ownership |
||||
|
fn_check_permissions |
||||
|
fn_check_permissions_conclusion |
@ -1,11 +1,11 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
# LGSM check_root.sh function |
# LGSM check_root.sh function |
||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Website: http://gameservermanagers.com |
# Website: https://gameservermanagers.com |
||||
lgsm_version="060316" |
lgsm_version="210516" |
||||
|
|
||||
if [ $(whoami) = "root" ]; then |
if [ $(whoami) = "root" ]; then |
||||
fn_printfailnl "Do NOT run this script as root!" |
fn_print_fail_nl "Do NOT run this script as root!" |
||||
if [ -d "${scriptlogdir}" ]; then |
if [ -d "${scriptlogdir}" ]; then |
||||
fn_scriptlog "${selfname} attempted to run as root." |
fn_scriptlog "${selfname} attempted to run as root." |
||||
fi |
fi |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue