Browse Source

Merge remote-tracking branch 'upstream/master' into ts3server-installer

pull/405/head
Daniel Gibbs 10 years ago
parent
commit
02591b5ccf
  1. 2
      functions/fn_check_logs
  2. 4
      functions/fn_check_steamuser
  3. 2
      functions/fn_getopt
  4. 4
      functions/fn_monitor
  5. 21
      functions/fn_monitor_query
  6. 13
      functions/fn_update_check

2
functions/fn_check_logs

@ -6,7 +6,7 @@
# Description: Checks that log files exist on server start
# Create dir's for the script and console logs
if [ ! -f "${scriptlogdir}" ]; then
if [ ! -d "${scriptlogdir}" ]; then
fn_printdots "Checking for log files"
sleep 1
fn_printinfo "Checking for log files: Creating log files"

4
functions/fn_check_steamuser

@ -4,8 +4,8 @@
# Website: http://gameservermanagers.com
# Version: 190515
if [ -z "${steamuser}" ]||[ "${steamuser}" == "username" ];; then
fn_printwarningnl "Steam Login not set. Using anonymous login."
if [ -z "${steamuser}" ]||[ "${steamuser}" == "username" ]; then
fn_printwarnnl "Steam login not set. Using anonymous login."
fn_scriptlog "Steam Login not set. Using anonymous login."
if [ "${steamuser}" == "username" ]; then
echo " * Change steamuser=\"username\" to a valid steam login."

2
functions/fn_getopt

@ -74,7 +74,7 @@ case "$getopt" in
auto-install)
fn_autoinstall;;
*)
echo "Usage: $0 {start|stop|restart|update|update-funtions|monitor|email-test|details|backup|install|auto-install}"
echo "Usage: $0 {start|stop|restart|update|update-funtions|monitor|email-test|details|backup}"
exit 1;;
esac
exit

4
functions/fn_monitor

@ -16,7 +16,7 @@ fn_logs
fn_printdots "${servername}"
fn_scriptlog "${servername}"
sleep 1
if [ ! -f "${lockselfname}" ]; then
if [ ! -f "${rootdir}/${lockselfname}" ]; then
fn_printinfo "Disabled: No lock file found"
fn_scriptlog "Disabled: No lock file found"
sleep 1
@ -61,7 +61,7 @@ fn_details_config
fn_printdots "${servername}"
fn_scriptlog "${servername}"
sleep 1
if [ ! -f "${lockselfname}" ]; then
if [ ! -f "${rootdir}/${lockselfname}" ]; then
fn_printinfo "Disabled: No lock file found"
fn_scriptlog "Disabled: No lock file found"
sleep 1

21
functions/fn_monitor_query

@ -8,7 +8,7 @@
# Detects if the server has frozen.
local modulename="Monitor"
if [ -f gsquery.py ]; then
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))
@ -27,7 +27,7 @@ if [ -f gsquery.py ]; then
fn_printdots "Querying port: ${ip}:${port} : QUERYING"
fn_scriptlog "Querying port: ${ip}:${port} : QUERYING"
sleep 1
serverquery=$(./gsquery.py -a ${ip} -p ${port} -e ${engine} 2>&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}"
@ -64,21 +64,21 @@ if [ -f gsquery.py ]; then
echo -en "\n"
exit
elif [ "${exitcode}" == "126" ]; then
fn_printfail "Querying port: ${ip}:${port} : ERROR: ./gsquery.py: Permission denied"
fn_scriptlog "Querying port: ${ip}:${port} : ERROR: ./gsquery.py: Permission denied"
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 gsquery.py
chmod +x -v "${rootdir}/gsquery.py"
exitcode=$?
if [ "${exitcode}" == "0" ]; then
fn_monitor_query
else
fn_printfailure "Unable to resolve automatically. Please manually fix permissions.\n"
owner=$(ls -al gsquery.py|awk '{ print $3 }')
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} gsquery.py\n\n"
echo -en "\nchown ${whoami}:${whoami} ${rootdir}/gsquery.py\n\n"
exit
fi
else
@ -86,7 +86,10 @@ if [ -f gsquery.py ]; then
fn_scriptlog "Querying port: ${ip}:${port} : UNKNOWN ERROR"
sleep 1
echo -en "\n"
./gsquery.py -a ${ip} -p ${port} -e ${engine}
${rootdir}/gsquery.py -a ${ip} -p ${port} -e ${engine}
exit
fi
fi
else
fn_printfail "Could not find ${rootdir}/gsquery.py"
fn_scriptlog "Could not find ${rootdir}/gsquery.py"
fi

13
functions/fn_update_check

@ -74,14 +74,11 @@ fn_logupdaterequest(){
# Checks for server update requests from server logs.
echo ""
fn_printdots "Checking for update: Server logs"
sleep 1
fn_printok "Checking for update: Server logs"
fn_scriptlog "Checking for update: Server logs"
sleep 1
requestrestart=$(grep -Ec "MasterRequestRestart" "${consolelog}")
echo "${requestrestart}"
if [ "${requestrestart}" -ge "1" ]; then
fn_printoknl "Server requesting update"
fn_printoknl "Checking for update: Server logs: Update requested"
sleep 1
echo ""
echo -ne "Applying update.\r"
@ -120,6 +117,12 @@ currentbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s '
# Gets availablebuild info
cd "${rootdir}/steamcmd"
# Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD
if [ -f "${rootdir}/Steam/appcache/appinfo.vdf" ]; then
rm -f "${rootdir}/Steam/appcache/appinfo.vdf"
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+\"public\"$" | 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"
@ -128,6 +131,7 @@ if [ -z "${availablebuild}" ]; then
fn_printfail "Checking for update: SteamCMD: Not returning version info"
fn_scriptlog "Failure! Checking for update: SteamCMD: Not returning version info"
sleep 2
exit
else
fn_printok "Checking for update: SteamCMD"
fn_scriptlog "Success! Checking for update: SteamCMD"
@ -297,6 +301,7 @@ else
fi
}
fn_check_logs
fn_printdots "Checking for update"
if [ "${gamename}" == "Teamspeak 3" ]; then
fn_teamspeak3_check

Loading…
Cancel
Save