Browse Source

Major rework to put subdirectories under lgsm directory, as a test. New games support function that has parameters set from hierarchially loaded gamedata files to stgart to move towards single-instance manager for all games

pull/525/head
Jared Ballou 9 years ago
parent
commit
b44f93085a
  1. 2
      .gitignore
  2. 63
      Insurgency/insserver
  3. 0
      Insurgency/lgsm/cfg/lgsm-default.cfg
  4. 0
      Insurgency/lgsm/dependencies/libc.so.6
  5. 0
      Insurgency/lgsm/dependencies/libm.so.6
  6. 0
      Insurgency/lgsm/dependencies/libpthread.so.0
  7. 0
      Insurgency/lgsm/dependencies/librt.so.1
  8. 2
      functions/command_backup.sh
  9. 96
      functions/command_dev_detect_deps.sh
  10. 4
      functions/command_monitor.sh
  11. 6
      functions/command_start.sh
  12. 6
      functions/command_stop.sh
  13. 4
      functions/fn_update_functions
  14. 2
      functions/install_gsquery.sh
  15. 12
      functions/install_logs.sh
  16. 6
      functions/install_ts3.sh
  17. 20
      functions/monitor_gsquery.sh
  18. 2
      functions/update_check.sh
  19. 6
      functions/update_dl.sh
  20. 4
      functions/update_functions.sh
  21. 10
      games/_default
  22. 33
      games/_srcds
  23. 13
      games/insurgency

2
.gitignore

@ -2,3 +2,5 @@
.idea
*/functions/*
*/cfg/servers/*
*/lgsm/functions/*
*/lgsm/cfg/servers/*

63
Insurgency/insserver

@ -12,12 +12,26 @@ version="180116"
selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}"))
# Directories
# Script root
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
scriptcfgdir="${rootdir}/cfg/servers"
# LGSM Support Files
lgsmdir="${rootdir}/lgsm"
# Temporary path to store and manipulate settings
settingsdir="${lgsmdir}/settings.tmp"
# Supported Game Data
gamesdir="${lgsmdir}/games"
# Config path for local instances
scriptcfgdir="${lgsmdir}/cfg/servers"
# Debugging, if debugflag exists send output to $debuglog
debugflag="${rootdir}/.dev-debug"
debuglog="${rootdir}/dev-debug.log"
debugflag="${lgsmdir}/.dev-debug"
debuglog="${lgsmdir}/dev-debug.log"
if [ -f "${debugflag}" ]; then
exec 5>${debuglog}
BASH_XTRACEFD="5"
@ -41,7 +55,7 @@ githubuser="jaredballou"
githubrepo="linuxgsm"
githubbranch="master"
#ipaddr=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
#ipaddr=$(ip addr show $(ip route | grep '^default' | awk '{print $NF}') | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/')
# Config files
cfg_file_default="${scriptcfgdir}/_default.cfg"
@ -126,6 +140,39 @@ fn_create_config(){
fi
}
fn_settings_flush(){
if [ -e $settingsdir ]
rm -rf $settingsdir > /dev/null
fi
mkdir -p $settingsdir
}
fn_settings_import(){
import="${gamesdir}/${1}"
if [ ! -e $import ]; then
fn_getgithubfile "games/${1}"
fi
source $import
}
fn_set_game_params(){
param_set=$1
param_name=$2
param_value=$3
param_comment=$4
fn_update_config $param_name $param_value "${settingsdir}/${param_set}" $param_comment
}
fn_get_game_params(){
param_set=$1
param_name=$2
param_default=$3
}
# Flush old setings buffer
fn_settings_flush
# Import this game's settings
fn_settings_import $game
# If defaults are missing, or from an older version, overwrite the file
# TODO: Perhaps pull this from Git instead?
#cfgver=$(grep lgsm_version ${cfg_file_default} 2>/dev/null | cut -d'=' -f2 | sed -e 's/["]//g')
@ -174,15 +221,15 @@ servercfg="${servicename}.cfg"
servercfgdir="${systemdir}/cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
servercfgdefault="${servercfgdir}/lgsm-default.cfg"
backupdir="${rootdir}/backups"
backupdir="${lgsmdir}/backups"
#In the event that you have library issues after an update, this may resolve it.
#export LD_LIBRARY_PATH="${filesdir}:${filesdir}/bin:${LD_LIBRARY_PATH}"
# Logging
gamelogdir="${systemdir}/logs"
scriptlogdir="${rootdir}/log/script"
consolelogdir="${rootdir}/log/console"
scriptlogdir="${lgsmdir}/log/script"
consolelogdir="${lgsmdir}/log/console"
scriptlog="${scriptlogdir}/${servicename}-script.log"
consolelog="${consolelogdir}/${servicename}-console.log"
@ -234,7 +281,7 @@ fn_getgithubfile(){
filename=$1
exec=$2
fileurl=${3:-$filename}
filepath="${rootdir}/${filename}"
filepath="${lgsmdir}/${filename}"
filedir=$(dirname "${filepath}")
# If the function file is missing, then download
if [ ! -f "${filepath}" ]; then

0
Insurgency/cfg/lgsm-default.cfg → Insurgency/lgsm/cfg/lgsm-default.cfg

0
Insurgency/dependencies/libc.so.6 → Insurgency/lgsm/dependencies/libc.so.6

0
Insurgency/dependencies/libm.so.6 → Insurgency/lgsm/dependencies/libm.so.6

0
Insurgency/dependencies/libpthread.so.0 → Insurgency/lgsm/dependencies/libpthread.so.0

0
Insurgency/dependencies/librt.so.1 → Insurgency/lgsm/dependencies/librt.so.1

2
functions/command_backup.sh

@ -49,7 +49,7 @@ sleep 1
echo -en "starting backup...\r"
sleep 1
echo -en "\n"
cd "${rootdir}"
cd "${lgsmdir}"
if [ ! -d "${backupdir}" ]; then
mkdir -v "${backupdir}"
fi

96
functions/command_dev_detect_deps.sh

@ -41,62 +41,62 @@ else
readelf=readelf
fi
${readelf} -d ${executable} |grep NEEDED|awk '{ print $5 }'|sed 's/\[//g'|sed 's/\]//g' > "${rootdir}/.depdetect_readelf"
${readelf} -d ${executable} |grep NEEDED|awk '{ print $5 }'|sed 's/\[//g'|sed 's/\]//g' > "${lgsmdir}/.depdetect_readelf"
echo "yum install " > "${rootdir}/.depdetect_centos_list_uniq"
echo "apt-get install " > "${rootdir}/.depdetect_ubuntu_list_uniq"
echo "apt-get install " > "${rootdir}/.depdetect_debian_list_uniq"
echo "yum install " > "${lgsmdir}/.depdetect_centos_list_uniq"
echo "apt-get install " > "${lgsmdir}/.depdetect_ubuntu_list_uniq"
echo "apt-get install " > "${lgsmdir}/.depdetect_debian_list_uniq"
while read lib; do
sharedlib=${lib}
if [ "${lib}" == "libm.so.6" ]||[ "${lib}" == "libc.so.6" ]||[ "${lib}" == "libpthread.so.0" ]||[ "${lib}" == "libdl.so.2" ]||[ "${lib}" == "libnsl.so.1" ]||[ "${lib}" == "libgcc_s.so.1" ]||[ "${lib}" == "librt.so.1" ]||[ "${lib}" == "ld-linux.so.2" ]; then
echo "glibc.i686" >> "${rootdir}/.depdetect_centos_list"
echo "lib32gcc1" >> "${rootdir}/.depdetect_ubuntu_list"
echo "lib32gcc1" >> "${rootdir}/.depdetect_debian_list"
echo "glibc.i686" >> "${lgsmdir}/.depdetect_centos_list"
echo "lib32gcc1" >> "${lgsmdir}/.depdetect_ubuntu_list"
echo "lib32gcc1" >> "${lgsmdir}/.depdetect_debian_list"
elif [ "${lib}" == "libstdc++.so.6" ]; then
echo "libstdc++.i686" >> "${rootdir}/.depdetect_centos_list"
echo "libstdc++6:i386" >> "${rootdir}/.depdetect_ubuntu_list"
echo "libstdc++6:i386" >> "${rootdir}/.depdetect_debian_list"
echo "libstdc++.i686" >> "${lgsmdir}/.depdetect_centos_list"
echo "libstdc++6:i386" >> "${lgsmdir}/.depdetect_ubuntu_list"
echo "libstdc++6:i386" >> "${lgsmdir}/.depdetect_debian_list"
elif [ "${lib}" == "libstdc++.so.5" ]; then
echo "compat-libstdc++-33.i686" >> "${rootdir}/.depdetect_centos_list"
echo "libstdc++5:i386" >> "${rootdir}/.depdetect_ubuntu_list"
echo "libstdc++5:i386" >> "${rootdir}/.depdetect_debian_list"
echo "compat-libstdc++-33.i686" >> "${lgsmdir}/.depdetect_centos_list"
echo "libstdc++5:i386" >> "${lgsmdir}/.depdetect_ubuntu_list"
echo "libstdc++5:i386" >> "${lgsmdir}/.depdetect_debian_list"
elif [ "${lib}" == "libspeex.so.1" ]||[ "${lib}" == "libspeexdsp.so.1" ]; then
echo "speex.i686" >> "${rootdir}/.depdetect_centos_list"
echo "speex:i386" >> "${rootdir}/.depdetect_ubuntu_list"
echo "speex:i386" >> "${rootdir}/.depdetect_debian_list"
echo "speex.i686" >> "${lgsmdir}/.depdetect_centos_list"
echo "speex:i386" >> "${lgsmdir}/.depdetect_ubuntu_list"
echo "speex:i386" >> "${lgsmdir}/.depdetect_debian_list"
elif [ "${lib}" == "./libSDL-1.2.so.0" ]||[ "${lib}" == "libSDL-1.2.so.0" ]; then
echo "SDL.i686" >> "${rootdir}/.depdetect_centos_list"
echo "libsdl1.2debian" >> "${rootdir}/.depdetect_ubuntu_list"
echo "libsdl1.2debian" >> "${rootdir}/.depdetect_debian_list"
echo "SDL.i686" >> "${lgsmdir}/.depdetect_centos_list"
echo "libsdl1.2debian" >> "${lgsmdir}/.depdetect_ubuntu_list"
echo "libsdl1.2debian" >> "${lgsmdir}/.depdetect_debian_list"
elif [ "${lib}" == "libtbb.so.2" ]; then
echo "tbb.i686" >> "${rootdir}/.depdetect_centos_list"
echo "libtbb2" >> "${rootdir}/.depdetect_ubuntu_list"
echo "libtbb2" >> "${rootdir}/.depdetect_debian_list"
echo "tbb.i686" >> "${lgsmdir}/.depdetect_centos_list"
echo "libtbb2" >> "${lgsmdir}/.depdetect_ubuntu_list"
echo "libtbb2" >> "${lgsmdir}/.depdetect_debian_list"
elif [ "${lib}" == "libtier0.so" ]||[ "${lib}" == "Core.so" ]||[ "${lib}" == "Editor.so" ]||[ "${lib}" == "Engine.so" ]||[ "${lib}" == "liblua.so" ]||[ "${lib}" == "libsteam_api.so" ]||[ "${lib}" == "ld-linux-x86-64.so.2" ]||[ "${lib}" == "libPhysX3_x86.so" ]||[ "${lib}" == "libPhysX3Common_x86.so" ]||[ "${lib}" == "libPhysX3Cooking_x86.so" ]; then
# Known shared libs what dont requires dependencies
:
else
unknownlib=1
echo "${lib}" >> "${rootdir}/.depdetect_unknown"
echo "${lib}" >> "${lgsmdir}/.depdetect_unknown"
fi
done < "${rootdir}/.depdetect_readelf"
sort "${rootdir}/.depdetect_centos_list" | uniq >> "${rootdir}/.depdetect_centos_list_uniq"
sort "${rootdir}/.depdetect_ubuntu_list" | uniq >> "${rootdir}/.depdetect_ubuntu_list_uniq"
sort "${rootdir}/.depdetect_debian_list" | uniq >> "${rootdir}/.depdetect_debian_list_uniq"
done < "${lgsmdir}/.depdetect_readelf"
sort "${lgsmdir}/.depdetect_centos_list" | uniq >> "${lgsmdir}/.depdetect_centos_list_uniq"
sort "${lgsmdir}/.depdetect_ubuntu_list" | uniq >> "${lgsmdir}/.depdetect_ubuntu_list_uniq"
sort "${lgsmdir}/.depdetect_debian_list" | uniq >> "${lgsmdir}/.depdetect_debian_list_uniq"
if [ "${unknownlib}" == "1" ]; then
sort "${rootdir}/.depdetect_unknown" | uniq >> "${rootdir}/.depdetect_unknown_uniq"
sort "${lgsmdir}/.depdetect_unknown" | uniq >> "${lgsmdir}/.depdetect_unknown_uniq"
fi
awk -vORS=' ' '{ print $1, $2 }' "${rootdir}/.depdetect_centos_list_uniq" > "${rootdir}/.depdetect_centos_line"
awk -vORS=' ' '{ print $1, $2 }' "${rootdir}/.depdetect_ubuntu_list_uniq" > "${rootdir}/.depdetect_ubuntu_line"
awk -vORS=' ' '{ print $1, $2 }' "${rootdir}/.depdetect_debian_list_uniq" > "${rootdir}/.depdetect_debian_line"
awk -vORS=' ' '{ print $1, $2 }' "${lgsmdir}/.depdetect_centos_list_uniq" > "${lgsmdir}/.depdetect_centos_line"
awk -vORS=' ' '{ print $1, $2 }' "${lgsmdir}/.depdetect_ubuntu_list_uniq" > "${lgsmdir}/.depdetect_ubuntu_line"
awk -vORS=' ' '{ print $1, $2 }' "${lgsmdir}/.depdetect_debian_list_uniq" > "${lgsmdir}/.depdetect_debian_line"
echo ""
echo "Required Dependencies"
@ -105,46 +105,46 @@ echo "${executable}"
echo ""
echo "CentOS"
echo "================================="
cat "${rootdir}/.depdetect_centos_line"
cat "${lgsmdir}/.depdetect_centos_line"
echo ""
echo ""
echo "Ubuntu"
echo "================================="
cat "${rootdir}/.depdetect_ubuntu_line"
cat "${lgsmdir}/.depdetect_ubuntu_line"
echo ""
echo ""
echo "Debian"
echo "================================="
cat "${rootdir}/.depdetect_debian_line"
cat "${lgsmdir}/.depdetect_debian_line"
echo ""
if [ "${unknownlib}" == "1" ]; then
echo ""
echo "Unknown shared Library"
echo "================================="
cat "${rootdir}/.depdetect_unknown"
cat "${lgsmdir}/.depdetect_unknown"
fi
echo ""
echo "Required Librarys"
echo "================================="
sort "${rootdir}/.depdetect_readelf" |uniq
sort "${lgsmdir}/.depdetect_readelf" |uniq
echo ""
echo "ldd"
echo "================================="
ldd ${executable}
echo -en "\n"
rm -f "${rootdir}/.depdetect_centos_line"
rm -f "${rootdir}/.depdetect_centos_list"
rm -f "${rootdir}/.depdetect_centos_list_uniq"
rm -f "${lgsmdir}/.depdetect_centos_line"
rm -f "${lgsmdir}/.depdetect_centos_list"
rm -f "${lgsmdir}/.depdetect_centos_list_uniq"
rm -f "${rootdir}/.depdetect_debian_line"
rm -f "${rootdir}/.depdetect_debian_list"
rm -f "${rootdir}/.depdetect_debian_list_uniq"
rm -f "${lgsmdir}/.depdetect_debian_line"
rm -f "${lgsmdir}/.depdetect_debian_list"
rm -f "${lgsmdir}/.depdetect_debian_list_uniq"
rm -f "${rootdir}/.depdetect_ubuntu_line"
rm -f "${rootdir}/.depdetect_ubuntu_list"
rm -f "${rootdir}/.depdetect_ubuntu_list_uniq"
rm -f "${lgsmdir}/.depdetect_ubuntu_line"
rm -f "${lgsmdir}/.depdetect_ubuntu_list"
rm -f "${lgsmdir}/.depdetect_ubuntu_list_uniq"
rm -f "${rootdir}/.depdetect_readelf"
rm -f "${lgsmdir}/.depdetect_readelf"
rm -f "${rootdir}/.depdetect_unknown"
rm -f "${rootdir}/.depdetect_unknown_uniq"
rm -f "${lgsmdir}/.depdetect_unknown"
rm -f "${lgsmdir}/.depdetect_unknown_uniq"

4
functions/command_monitor.sh

@ -16,7 +16,7 @@ logs.sh
fn_printdots "${servername}"
fn_scriptlog "${servername}"
sleep 1
if [ ! -f "${rootdir}/${lockselfname}" ]; then
if [ ! -f "${lgsmdir}/${lockselfname}" ]; then
fn_printinfo "Disabled: No lock file found"
fn_scriptlog "Disabled: No lock file found"
sleep 1
@ -59,7 +59,7 @@ info_config.sh
fn_printdots "${servername}"
fn_scriptlog "${servername}"
sleep 1
if [ ! -f "${rootdir}/${lockselfname}" ]; then
if [ ! -f "${lgsmdir}/${lockselfname}" ]; then
fn_printinfo "Disabled: No lock file found"
fn_scriptlog "Disabled: No lock file found"
sleep 1

6
functions/command_start.sh

@ -53,7 +53,7 @@ fi
mv "${scriptlog}" "${scriptlogdate}"
# Create lock file
date > "${rootdir}/${lockselfname}"
date > "${lgsmdir}/${lockselfname}"
cd "${executabledir}"
if [ "${ts3serverpass}" == "1" ];then
./ts3server_startscript.sh start serveradmin_password="${newpassword}"
@ -65,7 +65,7 @@ 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"
echo -e " Check log files: ${lgsmdir}/log"
exit 1
else
fn_printok "${servername}"
@ -112,7 +112,7 @@ if [ "${tmuxwc}" -eq 1 ]; then
fi
# Create lock file
date > "${rootdir}/${lockselfname}"
date > "${lgsmdir}/${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

6
functions/command_stop.sh

@ -44,7 +44,7 @@ else
fn_scriptlog "Stopped ${servername}"
fi
# Remove lock file
rm -f "${rootdir}/${lockselfname}"
rm -f "${lgsmdir}/${lockselfname}"
sleep 1
echo -en "\n"
}
@ -147,7 +147,7 @@ else
fi
fi
# Remove lock file
rm -f "${rootdir}/${lockselfname}"
rm -f "${lgsmdir}/${lockselfname}"
sleep 1
echo -en "\n"
}
@ -156,4 +156,4 @@ if [ "${gamename}" == "Teamspeak 3" ]; then
fn_stop_teamspeak3
else
fn_stop_tmux
fi
fi

4
functions/fn_update_functions

@ -10,7 +10,7 @@ fn_printdots "Updating functions"
fn_scriptlog "Updating functions"
sleep 1
echo -ne "\n"
rm -rfv "${rootdir}/functions/"*
rm -rfv "${lgsmdir}/functions/"*
exitcode=$?
if [ "${exitcode}" == "0" ]; then
fn_printok "Updating functions"
@ -19,4 +19,4 @@ else
fn_printokfail "Updating functions"
fn_scriptlog "Failure! Updating functions"
fi
echo -ne "\n"
echo -ne "\n"

2
functions/install_gsquery.sh

@ -5,7 +5,7 @@
lgsm_version="271215"
fn_dlgsquery(){
cd "${rootdir}"
cd "${lgsmdir}"
echo -e "downloading gsquery.py...\c"
wget -N /dev/null "http://gameservermanagers.com/dl/gsquery.py" 2>&1 | grep -F "HTTP" | grep -v "Moved Permanently" | cut -c45- | uniq
chmod +x gsquery.py

12
functions/install_logs.sh

@ -11,7 +11,7 @@ if [ "${checklogs}" != "1" ]; then
fi
sleep 1
# Create dir's for the script and console logs
mkdir -v "${rootdir}/log"
mkdir -v "${lgsmdir}/log"
mkdir -v "${scriptlogdir}"
touch "${scriptlog}"
if [ -n "${consolelogdir}" ]; then
@ -21,8 +21,8 @@ fi
# If a server is source or goldsource, Teamspeak 3, Starbound, Project Zomhoid create a symbolic link to the game server logs.
if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${gamename}" == "Teamspeak 3" ]||[ "${engine}" == "starbound" ]||[ "${engine}" == "projectzomboid" ]; then
if [ ! -h "${rootdir}/log/server" ]; then
ln -nfsv "${gamelogdir}" "${rootdir}/log/server"
if [ ! -h "${lgsmdir}/log/server" ]; then
ln -nfsv "${gamelogdir}" "${lgsmdir}/log/server"
fi
fi
@ -40,8 +40,8 @@ fi
# If server uses SteamCMD create a symbolic link to the Steam logs.
if [ -d "${rootdir}/Steam/logs" ]; then
if [ ! -h "${rootdir}/log/steamcmd" ]; then
ln -nfsv "${rootdir}/Steam/logs" "${rootdir}/log/steamcmd"
if [ ! -h "${lgsmdir}/log/steamcmd" ]; then
ln -nfsv "${rootdir}/Steam/logs" "${lgsmdir}/log/steamcmd"
fi
fi
sleep 1
sleep 1

6
functions/install_ts3.sh

@ -48,7 +48,7 @@ if [ -z "${availablebuild}" ]; then
exit 1
fi
cd "${rootdir}"
cd "${lgsmdir}"
echo -e "downloading teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz...\c"
wget -N /dev/null http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux-${ts3arch}-${ts3_version_number}.tar.gz 2>&1 | grep -F HTTP | cut -c45-| uniq
sleep 1
@ -65,7 +65,7 @@ else
exit $?
fi
echo -e "copying to ${filesdir}...\c"
cp -R "${rootdir}/teamspeak3-server_linux-${ts3arch}/"* "${filesdir}" 2> ".${servicename}-cp-error.tmp"
cp -R "${lgsmdir}/teamspeak3-server_linux-${ts3arch}/"* "${filesdir}" 2> ".${servicename}-cp-error.tmp"
local status=$?
if [ ${status} -eq 0 ]; then
echo "OK"
@ -77,4 +77,4 @@ else
exit $?
fi
rm -f teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz
rm -rf "${rootdir}/teamspeak3-server_linux-${ts3arch}"
rm -rf "${lgsmdir}/teamspeak3-server_linux-${ts3arch}"

20
functions/monitor_gsquery.sh

@ -8,7 +8,7 @@ lgsm_version="271215"
# Detects if the server has frozen.
local modulename="Monitor"
if [ -f "${rootdir}/gsquery.py" ]; then
if [ -f "${lgsmdir}/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))
@ -30,7 +30,7 @@ if [ -f "${rootdir}/gsquery.py" ]; then
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)
serverquery=$("${lgsmdir}/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}"
@ -67,20 +67,20 @@ if [ -f "${rootdir}/gsquery.py" ]; then
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"
fn_printfail "Querying port: ${ip}:${port} : ERROR: ${lgsmdir}/gsquery.py: Permission denied"
fn_scriptlog "Querying port: ${ip}:${port} : ERROR: ${lgsmdir}/gsquery.py: Permission denied"
sleep 1
echo -en "\n"
echo "Attempting to resolve automatically"
chmod +x -v "${rootdir}/gsquery.py"
chmod +x -v "${lgsmdir}/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 }')
owner=$(ls -al ${lgsmdir}/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"
echo -en "\nchown ${whoami}:${whoami} ${lgsmdir}/gsquery.py\n\n"
exit 1
fi
else
@ -88,10 +88,10 @@ if [ -f "${rootdir}/gsquery.py" ]; then
fn_scriptlog "Querying port: ${ip}:${port} : UNKNOWN ERROR"
sleep 1
echo -en "\n"
${rootdir}/gsquery.py -a ${ip} -p ${port} -e ${engine}
${lgsmdir}/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"
fn_printfailnl "Could not find ${lgsmdir}/gsquery.py"
fn_scriptlog "Could not find ${lgsmdir}/gsquery.py"
fi

2
functions/update_check.sh

@ -206,7 +206,7 @@ if [ -z "$(find ./* -name 'ts3server*_0.log')" ]; then
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}')
currentbuild=$(cat $(find ./* -name 'ts3server*_0.log' 2> /dev/null | sort | egrep -E -v '${lgsmdir}/.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
ts3arch=$(ls $(find ${filesdir}/ -name 'ts3server_*_*' 2> /dev/null | grep -v 'ts3server_minimal_runscript.sh' | sort | tail -1) | egrep -o '(amd64|x86)' | tail -1)

6
functions/update_dl.sh

@ -28,7 +28,7 @@ fix.sh
}
fn_teamspeak3_dl(){
cd "${rootdir}"
cd "${lgsmdir}"
echo -e "downloading teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz...\c"
fn_scriptlog "Downloading teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz"
wget -N /dev/null http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux-${ts3arch}-${ts3_version_number}.tar.gz 2>&1 | grep -F HTTP | cut -c45-| uniq
@ -51,7 +51,7 @@ else
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"
cp -R "${lgsmdir}/teamspeak3-server_linux-${ts3arch}/"* "${filesdir}" 2> "${scriptlogdir}/.${servicename}-cp-error.tmp"
local status=$?
if [ ${status} -eq 0 ]; then
echo "OK"
@ -66,7 +66,7 @@ else
exit ${status}
fi
rm -f teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz
rm -rf "${rootdir}/teamspeak3-server_linux-${ts3arch}"
rm -rf "${lgsmdir}/teamspeak3-server_linux-${ts3arch}"
}
check.sh

4
functions/update_functions.sh

@ -12,7 +12,7 @@ fn_printdots "Updating functions"
fn_scriptlog "Updating functions"
sleep 1
echo -ne "\n"
rm -rfv "${rootdir}/functions/"*
rm -rfv "${lgsmdir}/functions/"*
exitcode=$?
if [ "${exitcode}" == "0" ]; then
fn_printok "Updating functions"
@ -21,4 +21,4 @@ else
fn_printokfail "Updating functions"
fn_scriptlog "Failure! Updating functions"
fi
echo -ne "\n"
echo -ne "\n"

10
games/_default

@ -0,0 +1,10 @@
# Game Settings File
# _default
# Base defaults for all games
fn_set_game_params settings "email" "[email protected]" "Email address for notification
fn_set_game_params settings "emailnotification" "off" "Email notification (on|off)
fn_set_game_params settings "ip" "0.0.0.0" "IP Address to bind for server
fn_set_game_params settings "lgsm_version" "${version}" "Version of LGSM that created this config"
fn_set_game_params settings "logdays" "7" "Number of days to retain logs"
fn_set_game_params settings "updateonstart" "off" "Update game on start"

33
games/_srcds

@ -0,0 +1,33 @@
# Game Settings File
# _srcds
# Base SRCDS Game
fn_settings_import _default
fn_set_game_params params "" "params_minus params_plus"
fn_set_game_params params_minus "-game" "game"
fn_set_game_params params_minus "-strictportbind" ""
fn_set_game_params params_minus "-ip" "ip"
fn_set_game_params params_minus "-port" "port"
fn_set_game_params params_minus "-maxplayers" "maxplayers"
fn_set_game_params params_plus "+clientport" "clientport"
fn_set_game_params params_plus "+tv_port" "sourcetvport"
fn_set_game_params params_plus "+sv_playlist" "playlist"
fn_set_game_params params_plus "+mapcyclefile" "mapcyclefile"
fn_set_game_params params_plus "+servercfgfile" "servercfg"
fn_set_game_params params_plus "+map" "defaultmap"
fn_set_game_params settings "appid" "204" "Steam App ID"
fn_set_game_params settings "clientport" "27005" "Client Port"
fn_set_game_params settings "defaultmap" "dm_lockdown" "Default map to load"
fn_set_game_params settings "game" "hl2mp" "Name of game to pass to srcds"
fn_set_game_params settings "mapcyclefile" "mapcycle.txt" "Map Cycle File"
fn_set_game_params settings "maxplayers" "64" "Maximum player count"
fn_set_game_params settings "playlist" "custom" "Playlist"
fn_set_game_params settings "port" "27015" "Port to bind for server"
fn_set_game_params settings "servercfg" "${instance}.cfg" "Server Config file"
fn_set_game_params settings "sourcetvport" "27020" "SourceTV Port"
fn_set_game_params settings "srcds_parms" "" "Additional SRCDS Parameters. Put the parameters that start with \"-\" first, then \"+\" parameters after"
fn_set_game_params settings "steampass" "" ""
fn_set_game_params settings "steamuser" "anonymous" ""

13
games/insurgency

@ -0,0 +1,13 @@
# Game Settings File
# insurgency
# Insurgency Dedicated Server
fn_settings_import _srcds
fn_set_game_params params_plus "+sv_playlist" "playlist"
fn_set_game_params settings "appid" "237410"
fn_set_game_params settings "defaultmap" "ministry checkpoint"
fn_set_game_params settings "game" "insurgency"
fn_set_game_params settings "mapcyclefile" "mapcycle.txt"
fn_set_game_params settings "playlist" "custom" "Server Playlist"
Loading…
Cancel
Save