Browse Source

new feature gamedig

pull/1915/head
Daniel Gibbs 7 years ago
parent
commit
c2bef39ad2
  1. 2
      lgsm/config-default/config-lgsm/ut3server/_default.cfg
  2. 4
      lgsm/functions/alert.sh
  3. 1
      lgsm/functions/check_ip.sh
  4. 3
      lgsm/functions/command_details.sh
  5. 40
      lgsm/functions/command_dev_query_raw.sh
  6. 183
      lgsm/functions/command_monitor.sh
  7. 3
      lgsm/functions/core_exit.sh
  8. 14
      lgsm/functions/core_functions.sh
  9. 3
      lgsm/functions/core_getopt.sh
  10. 4
      lgsm/functions/info_config.sh
  11. 9
      lgsm/functions/info_distro.sh
  12. 59
      lgsm/functions/info_messages.sh
  13. 9
      lgsm/functions/info_parms.sh
  14. 3
      lgsm/functions/install_config.sh
  15. 86
      lgsm/functions/monitor_gsquery.sh
  16. 96
      lgsm/functions/query_gamedig.sh
  17. 6
      lgsm/functions/query_gsquery.py
  18. 66
      tests/tests_jc2server.sh
  19. 44
      tests/tests_ts3server.sh

2
lgsm/config-default/config-lgsm/ut3server/_default.cfg

@ -11,7 +11,7 @@
## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters ## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
ip="0.0.0.0" ip="0.0.0.0"
port="7777" port="7777"
queryport="25300" queryport="6500"
defaultmap="VCTF-Suspense" defaultmap="VCTF-Suspense"
game="UTGameContent.UTVehicleCTFGame_Content" game="UTGameContent.UTVehicleCTFGame_Content"
mutators="" #"UTGame.UTMutator_Instagib,UTGame.UTMutator_LowGrav" mutators="" #"UTGame.UTMutator_Instagib,UTGame.UTMutator_LowGrav"

4
lgsm/functions/alert.sh

@ -45,12 +45,12 @@ fn_alert_restart(){
} }
fn_alert_restart_query(){ fn_alert_restart_query(){
fn_script_log_info "Sending alert: Restarted: ${gsquerycmd}" fn_script_log_info "Sending alert: Restarted: ${servicename}"
alertsubject="Alert - ${servicename} - Restarted" alertsubject="Alert - ${servicename} - Restarted"
alertemoji="🚨" alertemoji="🚨"
alertsound="2" alertsound="2"
alerturl="not enabled" alerturl="not enabled"
alertbody="gsquery.py failed to query: ${gsquerycmd}" alertbody="Unable to query: ${servicename}"
} }
fn_alert_update(){ fn_alert_update(){

1
lgsm/functions/check_ip.sh

@ -17,6 +17,7 @@ if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travi
getip=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0) getip=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0)
getipwc=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -vc 127.0.0) getipwc=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -vc 127.0.0)
info_config.sh info_config.sh
info_parms.sh
# IP is not set to specific IP # IP is not set to specific IP
if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then

3
lgsm/functions/command_details.sh

@ -12,10 +12,11 @@ local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Run checks and gathers details to display. # Run checks and gathers details to display.
check.sh check.sh
info_config.sh info_config.sh
info_parms.sh
info_distro.sh info_distro.sh
info_glibc.sh info_glibc.sh
info_parms.sh
info_messages.sh info_messages.sh
query_gamedig.sh
fn_info_message_distro fn_info_message_distro
fn_info_message_performance fn_info_message_performance
fn_info_message_disk fn_info_message_disk

40
lgsm/functions/command_dev_query_raw.sh

@ -0,0 +1,40 @@
#!/bin/bash
# command_dev_query_raw.sh function
# Author: Daniel Gibbs
# Website: https://gameservermanagers.com
# Description: Raw gamedig output of the server.
echo "================================="
echo "Gamedig Raw Output"
echo "================================="
echo""
if [ ! "$(command -v gamedig 2>/dev/null)" ]; then
fn_print_failure_nl "gamedig not installed"
fi
if [ ! "$(command -v jq >/dev/null 2>&1)" ]; then
fn_print_failure_nl "jq not installed"
fi
info_config.sh
info_parms.sh
if [ "${engine}" == "idtech3_ql" ]; then
local engine="quakelive"
elif [ "${gamename}" == "Killing Floor 2" ]; then
local engine="unreal4"
fi
query_gamedig.sh
echo "gamedig --type \"${gamedigengine}\" --host \"${ip}\" --port \"${port}\"|jq"
echo""
echo "${gamedigraw}" | jq
echo""
echo "================================="
echo "gsquery Raw Output"
echo "================================="
echo""
echo "./query_gsquery.py -a \"${ip}\" -p \"${port}\" -e \"${engine}\""
if [ ! -f "${functionsdir}/query_gsquery.py" ]; then
fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nomd5"
fi
"${functionsdir}"/query_gsquery.py -a "${ip}" -p "${port}" -e "${engine}"

183
lgsm/functions/command_monitor.sh

@ -4,12 +4,82 @@
# Contributor: UltimateByte # Contributor: UltimateByte
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Monitors server by checking for running processes. # Description: Monitors server by checking for running processes.
# then passes to monitor_gsquery.sh. # then passes to gamedig and gsquery.
local commandname="MONITOR" local commandname="MONITOR"
local commandaction="Monitor" local commandaction="Monitor"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_monitor_loop(){
# Will query up to 5 times every 15 seconds.
# Query will wait up to 60 seconds to confirm server is down giving server time if changing map.
for queryattempt in {1..5}; do
fn_print_dots "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: "
fn_print_querying_eol
fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : QUERYING"
sleep 0.5
if [ "${querymethod}" == "gamedig" ];then
query_gamedig.sh
elif [ "${querymethod}" == "gsquery" ];then
if [ ! -f "${functionsdir}/query_gsquery.py" ]; then
fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nomd5"
fi
"${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${engine}" > /dev/null 2>&1
querystatus="$?"
elif [ "${querymethod}" == "telnet" ];then
bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''
querystatus="$?"
fi
if [ "${querystatus}" == "0" ]; then
# Server query OK
sleep 0.5
fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: "
fn_print_ok_eol_nl
fn_script_log_pass "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: OK"
exitcode=0
monitorpass=1
core_exit.sh
else
# Server query FAIL
fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: FAIL"
fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: "
fn_print_fail_eol
sleep 1
# monitor try gamedig first then gsquery before restarting
if [ "${querymethod}" == "gsquery" ];then
if [ "${totalseconds}" -ge "59" ]; then
# Server query FAIL for over 59 seconds reboot server
fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: "
fn_print_fail_eol_nl
fn_script_log_error "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: FAIL"
sleep 1
# Send alert if enabled
alert="restartquery"
alert.sh
command_restart.sh
core_exit.sh
fi
elif [ "${querymethod}" == "gamedig" ];then
if [ "${totalseconds}" -ge "29" ]; then
break
fi
fi
# Seconds counter
for seconds in {1..15}; do
fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: WAIT"
totalseconds=$((totalseconds + 1))
sleep 1
if [ "${seconds}" == "15" ]; then
break
fi
done
fi
done
}
fn_monitor_check_lockfile(){ fn_monitor_check_lockfile(){
# Monitor does not run it lockfile is not found # Monitor does not run it lockfile is not found
if [ ! -f "${rootdir}/${lockselfname}" ]; then if [ ! -f "${rootdir}/${lockselfname}" ]; then
@ -30,77 +100,72 @@ fn_monitor_check_update(){
fi fi
} }
fn_monitor_msg_checking(){ fn_monitor_check_session(){
fn_print_dots "Checking session: " fn_print_dots "Checking session: "
fn_print_checking_eol fn_print_checking_eol
fn_script_log_info "Checking session: CHECKING" fn_script_log_info "Checking session: CHECKING"
sleep 1 sleep 1
}
fn_monitor_teamspeak3(){
if [ "${status}" != "0" ]; then if [ "${status}" != "0" ]; then
fn_print_ok "Checking session: " fn_print_ok "Checking session: "
fn_print_ok_eol_nl fn_print_ok_eol_nl
fn_script_log_pass "Checking session: OK" fn_script_log_pass "Checking session: OK"
else else
fn_print_error "Checking session: ${ts3error}: " if [ "${gamename}" == "TeamSpeak 3" ]; then
fn_print_error "Checking session: ${ts3error}: "
elif [ "${gamename}" == "Mumble" ]; then
fn_print_error "Checking session: Not listening to port ${queryport}"
else
fn_print_error "Checking session: "
fi
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_error "Checking session: ${ts3error}: FAIL" fn_script_log_error "Checking session: FAIL"
failurereason="${ts3error}"
alert="restart" alert="restart"
alert.sh alert.sh
fn_script_log_info "Monitor is starting ${servername}" fn_script_log_info "Monitor is starting ${servername}"
sleep 1 sleep 1
command_restart.sh command_restart.sh
fi fi
sleep 1
} }
fn_monitor_mumble(){ fn_monitor_query(){
if [ "${status}" != "0" ]; then fn_script_log_info "Querying port: query enabled"
fn_print_ok "Checking session: " # engines that work with query
fn_print_ok_eol_nl local allowed_engines_array=( avalanche2.0 avalanche3.0 goldsource idtech2 idtech3 idtech3_ql iw2.0 iw3.0 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 unreal4 )
fn_script_log_pass "Checking session: OK" for allowed_engine in "${allowed_engines_array[@]}"
else do
fn_print_error "Checking session: Not listening to port ${port}" if [ "${engine}" == "idtech3_ql" ]; then
fn_print_fail_eol_nl local engine="quakelive"
fn_script_log_error "Checking session: Not listening to port ${port}" elif [ "${gamename}" == "Killing Floor 2" ]; then
failurereason="Checking session: Not listening to port ${port}" local engine="unreal4"
alert="restart" fi
alert.sh
fn_script_log_info "Monitor is starting ${servername}" # will first attempt to use gamedig then gsquery
sleep 1 totalseconds=0
command_restart.sh local query_methods_array=( gamedig gsquery )
fi for query_method in "${query_methods_array[@]}"
}
fn_monitor_tmux(){
# checks that tmux session is running
if [ "${status}" != "0" ]; then
fn_print_ok "Checking session: "
fn_print_ok_eol_nl
fn_script_log_pass "Checking session: OK"
# runs gsquery check on game with specific engines.
local allowed_engines_array=( avalanche2.0 avalanche3.0 goldsource idtech2 idtech3 idtech3_ql iw2.0 iw3.0 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 unreal4 )
for allowed_engine in "${allowed_engines_array[@]}"
do do
if [ "${allowed_engine}" == "starbound" ]; then if [ "${query_method}" == "gamedig" ]; then
info_config.sh # will bypass gamedig if not installed
if [ "${queryenabled}" == "true" ]; then if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; then
monitor_gsquery.sh if [ -z "${monitorpass}" ]; then
querymethod="${query_method}"
fn_monitor_loop
fi
fi
else
if [ -z "${monitorpass}" ]; then
querymethod="${query_method}"
fn_monitor_loop
fi fi
elif [ "${allowed_engine}" == "${engine}" ]; then
monitor_gsquery.sh
fi fi
done done
else done
fn_print_error "Checking session: " }
fn_print_fail_eol_nl
fn_script_log_error "Checking session: FAIL" fn_monitor_query_telnet(){
alert="restart" querymethod="telnet"
alert.sh fn_monitor_loop
fn_script_log_info "Monitor is starting ${servername}"
sleep 1
command_restart.sh
fi
} }
monitorflag=1 monitorflag=1
@ -109,15 +174,21 @@ sleep 1
check.sh check.sh
logs.sh logs.sh
info_config.sh info_config.sh
info_parms.sh
fn_monitor_check_lockfile fn_monitor_check_lockfile
fn_monitor_check_update fn_monitor_check_update
fn_monitor_msg_checking fn_monitor_check_session
if [ "${gamename}" == "TeamSpeak 3" ]; then # Query has to be enabled in starbound config
fn_monitor_teamspeak3 if [ "${gamename}" == "starbound" ]; then
elif [ "${gamename}" == "Mumble" ]; then if [ "${queryenabled}" == "true" ]; then
fn_monitor_mumble fn_monitor_query
fi
elif [ "${gamename}" == "Teamspeak 3" ]; then
fn_monitor_query_telnet
else else
fn_monitor_tmux fn_monitor_query
fi fi
core_exit.sh core_exit.sh

3
lgsm/functions/core_exit.sh

@ -8,6 +8,9 @@ fn_exit_dev_debug(){
if [ -f "${rootdir}/.dev-debug" ]; then if [ -f "${rootdir}/.dev-debug" ]; then
echo "" echo ""
echo "${function_selfname} exiting with code: ${exitcode}" echo "${function_selfname} exiting with code: ${exitcode}"
if [ -f "${rootdir}/dev-debug.log" ]; then
grep "functionfile=" "${rootdir}/dev-debug.log"| sed 's/functionfile=//g' > "${rootdir}/dev-debug-function-order.log"
fi
fi fi
} }

14
lgsm/functions/core_functions.sh

@ -269,6 +269,11 @@ functionfile="${FUNCNAME}"
fn_fetch_function fn_fetch_function
} }
command_dev_query_raw.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
}
# Fix # Fix
fix.sh(){ fix.sh(){
@ -363,6 +368,11 @@ functionfile="${FUNCNAME}"
fn_fetch_function fn_fetch_function
} }
info_gamedig.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
}
info_glibc.sh(){ info_glibc.sh(){
functionfile="${FUNCNAME}" functionfile="${FUNCNAME}"
fn_fetch_function fn_fetch_function
@ -426,9 +436,9 @@ functionfile="${FUNCNAME}"
fn_fetch_function fn_fetch_function
} }
# Monitor # Query
monitor_gsquery.sh(){ query_gamedig.sh(){
functionfile="${FUNCNAME}" functionfile="${FUNCNAME}"
fn_fetch_function fn_fetch_function
} }

3
lgsm/functions/core_getopt.sh

@ -47,6 +47,7 @@ cmd_dev_debug=( "dev;developer" "command_dev_debug.sh" "Enable developer Mode."
cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies." ) cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies." )
cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc." ) cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc." )
cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies." ) cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies." )
cmd_dev_query_raw=( "qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery." )
cmd_dev_clear_functions=( "cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir." ) cmd_dev_clear_functions=( "cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir." )
### Set specific opt here ### ### Set specific opt here ###
@ -131,7 +132,7 @@ currentopt+=( "${cmd_install[@]}" "${cmd_auto_install[@]}" )
## Developer commands ## Developer commands
currentopt+=( "${cmd_dev_debug[@]}" ) currentopt+=( "${cmd_dev_debug[@]}" )
if [ -f ".dev-debug" ]; then if [ -f ".dev-debug" ]; then
currentopt+=( "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_clear_functions[@]}" ) currentopt+=( "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" )
fi fi
### Build list of available commands ### Build list of available commands

4
lgsm/functions/info_config.sh

@ -704,7 +704,6 @@ fn_info_config_unreal3(){
servername="${unavailable}" servername="${unavailable}"
serverpassword="${unavailable}" serverpassword="${unavailable}"
adminpassword="${unavailable}" adminpassword="${unavailable}"
port="${unavailable}"
webadminenabled="${unavailable}" webadminenabled="${unavailable}"
webadminport="${zero}" webadminport="${zero}"
webadminuser="${unavailable}" webadminuser="${unavailable}"
@ -712,7 +711,6 @@ fn_info_config_unreal3(){
else else
servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
port=$(grep "Port" "${servercfgdir}/UTEngine.ini" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]')
webadminenabled=$(grep "bEnabled" "${servercfgdir}/UTWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') webadminenabled=$(grep "bEnabled" "${servercfgdir}/UTWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
webadminport=$(grep "ListenPort" "${servercfgdir}/UTWeb.ini" | grep -v "#" | tr -cd '[:digit:]') webadminport=$(grep "ListenPort" "${servercfgdir}/UTWeb.ini" | grep -v "#" | tr -cd '[:digit:]')
webadminuser="Admin" webadminuser="Admin"
@ -736,13 +734,13 @@ fn_info_config_kf2(){
serverpassword="${unavailable}" serverpassword="${unavailable}"
adminpassword="${unavailable}" adminpassword="${unavailable}"
port="${unavailable}" port="${unavailable}"
queryport="${unavailable}"
webadminenabled="${unavailable}" webadminenabled="${unavailable}"
webadminport="${zero}" webadminport="${zero}"
webadminuser="${unavailable}" webadminuser="${unavailable}"
webadminpass="${unavailable}" webadminpass="${unavailable}"
else else
servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
# Not in UT3
serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
port=$(grep "Port" "${servercfgdir}/LinuxServer-KFEngine.ini" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') port=$(grep "Port" "${servercfgdir}/LinuxServer-KFEngine.ini" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]')

9
lgsm/functions/info_distro.sh

@ -136,5 +136,12 @@ fi
# External IP address # External IP address
if [ -z "${extip}" ];then if [ -z "${extip}" ];then
extip=$(${curlpath} -m 3 ifconfig.co 2>/dev/null) extip=$(${curlpath} -m 3 ifconfig.co > "${tmpdir}/extip.txt" 2>/dev/null)
if [ $? -ne 0 ]; then
if [ -f "${tmpdir}/extip.txt" ];then
echo "${tmpdir}/extip.txt"
else
echo "x.x.x.x"
fi
fi
fi fi

59
lgsm/functions/info_messages.sh

@ -2,7 +2,7 @@
# LinuxGSM info_messages.sh function # LinuxGSM info_messages.sh function
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Defines server info messages for details, alerts. # Description: Defines server info messages for details and alerts.
# Standard Details # Standard Details
# This applies to all engines # This applies to all engines
@ -122,7 +122,9 @@ fn_info_message_gameserver(){
fn_messages_separator fn_messages_separator
{ {
# Server name # Server name
if [ -n "${servername}" ]; then if [ -n "${gdname}" ];then
echo -e "${blue}Server name:\t${default}${gdname}"
elif [ -n "${servername}" ]; then
echo -e "${blue}Server name:\t${default}${servername}" echo -e "${blue}Server name:\t${default}${servername}"
fi fi
@ -181,9 +183,43 @@ fn_info_message_gameserver(){
echo -e "${blue}Stats password:\t${default}${statspassword}" echo -e "${blue}Stats password:\t${default}${statspassword}"
fi fi
# Maxplayers # Players
if [ -n "${maxplayers}" ]; then
echo -e "${blue}Maxplayers:\t${default}${maxplayers}" if [ "${querystatus}" != "0" ]; then
if [ -n "${maxplayers}" ]; then
echo -e "${blue}Maxplayers:\t${default}${maxplayers}"
fi
else
if [ -n "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then
echo -e "${blue}Players:\t${default}${gdplayers}/${gdmaxplayers}"
elif [ -n "${gdplayers}" ]&&[ -n "${maxplayers}" ]; then
echo -e "${blue}Players:\t${default}${gdplayers}/${maxplayers}"
elif [ -z "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then
echo -e "${blue}Players:\t${default}0/${gdmaxplayers}"
elif [ -n "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]; then
echo -e "${blue}Players:\t${default}${gdplayers}|∞"
elif [ -z "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]&&[ -n "${maxplayers}" ]; then
echo -e "${blue}Maxplayers:\t${default}${maxplayers}"
fi
fi
# Bots
if [ -n "${gdbots}" ]; then
echo -e "${blue}Bots:\t${default}${gdbots}"
fi
# Current Map
if [ -n "${gdmap}" ]; then
echo -e "${blue}Current Map:\t${default}${gdmap}"
fi
# Default Map
if [ -n "${defaultmap}" ]; then
echo -e "${blue}Default Map:\t${default}${defaultmap}"
fi fi
# Game mode # Game mode
@ -406,19 +442,19 @@ fn_info_message_ports(){
for port_edit in "${ports_edit_array[@]}" for port_edit in "${ports_edit_array[@]}"
do do
if [ "${shortname}" == "ut3" ]; then if [ "${shortname}" == "ut3" ]; then
parmslocation="${servercfgdir}/UTEngine.ini\n${servercfgdir}/UTWeb.ini" parmslocation="${servercfgdir}/UTWeb.ini"
elif [ "${shortname}" == "kf2" ]; then elif [ "${shortname}" == "kf2" ]; then
parmslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini" parmslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini"
elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
parmslocation="${servercfgfullpath}" parmslocation="${servercfgfullpath}"
fi fi
done done
# engines/games that require editing in the script file # engines/games that require editing the parms
local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality") local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality")
for port_edit in "${ports_edit_array[@]}" for port_edit in "${ports_edit_array[@]}"
do do
if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
parmslocation="${selfname}" parmslocation="${configdirserver}"
fi fi
done done
echo -e "${parmslocation}" echo -e "${parmslocation}"
@ -948,7 +984,8 @@ fn_info_message_unreal3(){
echo -e "" echo -e ""
{ {
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp" echo -e "> Game\tINBOUND\t${port}\tudp"
echo -e "> Query\tINBOUND\t${queryport}\tudp"
echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
@ -967,8 +1004,8 @@ fn_info_message_kf2(){
echo -e "" echo -e ""
{ {
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game\tINBOUND\t${port}\ttcp" echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}"
echo -e "> Query\tINBOUND\t${queryport}\ttcp/udp" echo -e "> Query\tINBOUND\t${queryport}\tudp"
echo -e "> Steam\tINBOUND\t20560\tudp" echo -e "> Steam\tINBOUND\t20560\tudp"
echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
} | column -s $'\t' -t } | column -s $'\t' -t

9
lgsm/functions/info_parms.sh

@ -24,6 +24,7 @@ fn_info_parms_ark(){
fn_info_parms_realvirtuality(){ fn_info_parms_realvirtuality(){
port=${port:-"0"} port=${port:-"0"}
queryport=$((port + 1))
} }
fn_info_parms_cod(){ fn_info_parms_cod(){
@ -106,6 +107,12 @@ fn_info_config_towerunite(){
fn_info_parms_unreal(){ fn_info_parms_unreal(){
defaultmap=${defaultmap:-"NOT SET"} defaultmap=${defaultmap:-"NOT SET"}
queryport=$((port + 1))
}
fn_info_parms_unreal2(){
defaultmap=${defaultmap:-"NOT SET"}
queryport=$((port + 1))
} }
fn_info_parms_unreal3(){ fn_info_parms_unreal3(){
@ -158,7 +165,7 @@ elif [ "${gamename}" == "Tower Unite" ]; then
# Unreal/Unreal 2 engine # Unreal/Unreal 2 engine
elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
fn_info_parms_unreal fn_info_parms_unreal
# Unreal/Unreal 2 engine # Unreal 3 engine
elif [ "${engine}" == "unreal3" ]; then elif [ "${engine}" == "unreal3" ]; then
fn_info_parms_unreal3 fn_info_parms_unreal3
fi fi

3
lgsm/functions/install_config.sh

@ -38,12 +38,15 @@ fn_default_config_remote(){
echo "copying ${config} config file." echo "copying ${config} config file."
fn_script_log_info "copying ${servercfg} config file." fn_script_log_info "copying ${servercfg} config file."
if [ "${config}" == "${servercfgdefault}" ]; then if [ "${config}" == "${servercfgdefault}" ]; then
mkdir -p "${servercfgdir}"
cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}"
elif [ "${gamename}" == "ARMA 3" ]&&[ "${config}" == "${networkcfgdefault}" ]; then elif [ "${gamename}" == "ARMA 3" ]&&[ "${config}" == "${networkcfgdefault}" ]; then
mkdir -p "${servercfgdir}"
cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}"
elif [ "${gamename}" == "Don't Starve Together" ]&&[ "${config}" == "${clustercfgdefault}" ]; then elif [ "${gamename}" == "Don't Starve Together" ]&&[ "${config}" == "${clustercfgdefault}" ]; then
cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}"
else else
mkdir -p "${servercfgdir}"
cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}" cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}"
fi fi
done done

86
lgsm/functions/monitor_gsquery.sh

@ -1,86 +0,0 @@
#!/bin/bash
# LinuxGSM monitor_gsquery.sh function
# Author: Daniel Gibbs
# Website: https://linuxgsm.com
# Description: Uses gsquery.py to query the server port.
# Detects if the server has frozen with the process still running.
local commandname="MONITOR"
local commandaction="Monitor"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Downloads gsquery.py if missing
if [ ! -f "${functionsdir}/gsquery.py" ]; then
fn_fetch_file_github "lgsm/functions" "gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nomd5"
fi
info_config.sh
if [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
port=$((port + 1))
elif [ "${engine}" == "realvirtuality" ]; then
port=$((port + 1))
elif [ "${engine}" == "spark" ]; then
port=$((port + 1))
elif [ "${engine}" == "idtech3_ql" ]; then
engine="quakelive"
fi
if [ -n "${queryport}" ]; then
port="${queryport}"
fi
fn_print_info "Querying port: gsquery.py enabled"
fn_script_log_info "Querying port: gsquery.py enabled"
sleep 1
# Will query up to 4 times every 15 seconds.
# Servers changing map can return a failure.
# Will Wait up to 60 seconds to confirm server is down giving server time to change map.
totalseconds=0
for queryattempt in {1..5}; do
fn_print_dots "Querying port: ${ip}:${port} : ${totalseconds}/${queryattempt} : "
fn_print_querying_eol
fn_script_log_info "Querying port: ${ip}:${port} : ${queryattempt} : QUERYING"
gsquerycmd=$("${functionsdir}"/gsquery.py -a "${ip}" -p "${port}" -e "${engine}" 2>&1)
exitcode=$?
sleep 1
if [ "${exitcode}" == "0" ]; then
# Server OK
fn_print_ok "Querying port: ${ip}:${port} : ${queryattempt} : "
fn_print_ok_eol_nl
fn_script_log_pass "Querying port: ${ip}:${port} : ${queryattempt} : OK"
exitcode=0
break
else
# Server failed query
fn_script_log_info "Querying port: ${ip}:${port} : ${queryattempt} : ${gsquerycmd}"
if [ "${queryattempt}" == "5" ]; then
# Server failed query 4 times confirmed failure
fn_print_fail "Querying port: ${ip}:${port} : ${totalseconds}/${queryattempt} : "
fn_print_fail_eol_nl
fn_script_log_error "Querying port: ${ip}:${port} : ${queryattempt} : FAIL"
sleep 1
# Send alert if enabled
alert="restartquery"
alert.sh
command_restart.sh
break
fi
# Seconds counter
for seconds in {1..15}; do
fn_print_fail "Querying port: ${ip}:${port} : ${totalseconds}/${queryattempt} : ${red}${gsquerycmd}${default}"
totalseconds=$((totalseconds + 1))
sleep 1
if [ "${seconds}" == "15" ]; then
break
fi
done
fi
done
core_exit.sh

96
lgsm/functions/query_gamedig.sh

@ -0,0 +1,96 @@
#!/bin/bash
# query_gamedig.sh function
# Author: Daniel Gibbs
# Website: https://gameservermanagers.com
# Description: Querys a gameserver using node-gamedig.
# https://github.com/sonicsnes/node-gamedig
#Check if gamedig and jq are installed
if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; then
if [ "${engine}" == "idtech3_ql" ]; then
local engine="quakelive"
elif [ "${gamename}" == "Killing Floor 2" ]; then
local engine="unreal4"
fi
local engine_query_array=( avalanche3.0 madness quakelive realvirtuality refractor source goldsource spark starbound unity3d unreal4 )
for engine_query in "${engine_query_array[@]}"
do
if [ "${engine_query}" == "${engine}" ]; then
gamedigengine="protocol-valve"
fi
done
local engine_query_array=( avalanche2.0 )
for engine_query in "${engine_query_array[@]}"
do
if [ "${engine_query}" == "${engine}" ]; then
gamedigengine="jc2mp"
fi
done
local engine_query_array=( idtech2 iw2.0 )
for engine_query in "${engine_query_array[@]}"
do
if [ "${engine_query}" == "${engine}" ]; then
gamedigengine="protocol-quake2"
fi
done
local engine_query_array=( idtech3 quake iw3.0 )
for engine_query in "${engine_query_array[@]}"
do
if [ "${engine_query}" == "${engine}" ]; then
gamedigengine="protocol-quake3"
fi
done
local shortname_query_array=( ts3 )
for shortname_query in "${shortname_query_array[@]}"
do
if [ "${shortname_query}" == "${shortname}" ]; then
gamedigengine="teamspeak3"
fi
done
# will bypass query if server offline
check_status.sh
if [ "${status}" != "0" ]; then
# checks if query is working 0 = pass
querystatus=$(gamedig --type "${gamedigengine}" --host "${ip}" --port "${queryport}" | jq '.error|length')
# raw output
gamedigraw=$(gamedig --type "${gamedigengine}" --host "${ip}" --port "${queryport}")
# server name
gdname=$(echo "${gamedigraw}" | jq -re '.name')
if [ "${gdname}" == "null" ]; then
gdname=
fi
# numplayers
gdplayers=$(echo "${gamedigraw}" | jq -re '.players|length')
if [ "${gdplayers}" == "null" ]; then
gdplayers=
fi
# maxplayers
gdmaxplayers=$(echo "${gamedigraw}" | jq -re '.maxplayers|length')
if [ "${gdmaxplayers}" == "null" ]; then
maxplayers=
fi
# current map
gdmap=$(echo "${gamedigraw}" | jq -re '.map')
if [ "${gdmap}" == "null" ]; then
gdmap=
fi
# numbots
gdbots=$(echo "${gamedigraw}" | jq -re '.raw.numbots')
if [ "${gdbots}" == "null" ]; then
gdbots=
fi
fi
fi

6
lgsm/functions/gsquery.py → lgsm/functions/query_gsquery.py

@ -1,6 +1,6 @@
#! /usr/bin/env python #! /usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# PythonGSQ # query_gsquery.py
# Author: Anonymous & Daniel Gibbs # Author: Anonymous & Daniel Gibbs
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Allows querying of various game servers. # Description: Allows querying of various game servers.
@ -9,7 +9,7 @@ import optparse
import socket import socket
import sys import sys
class PythonGSQ: class gsquery:
def __init__(self, options, arguments): def __init__(self, options, arguments):
self.option = options self.option = options
self.argument = arguments self.argument = arguments
@ -118,5 +118,5 @@ if __name__ == '__main__':
) )
options, arguments = parser.parse_args() options, arguments = parser.parse_args()
# #
server = PythonGSQ(options, arguments) server = gsquery(options, arguments)
server.responding() server.responding()

66
tests/tests_jc2server.sh

@ -475,7 +475,7 @@ echo ""
) )
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "0.2 - Enable dev-debug" echo "0.2 - Enable dev-debug"
echo "=================================" echo "================================="
@ -491,7 +491,7 @@ echo ""
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "1.0 - start - no files" echo "1.0 - start - no files"
@ -509,7 +509,7 @@ echo ""
fn_test_result_fail fn_test_result_fail
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "1.1 - getopt" echo "1.1 - getopt"
@ -527,7 +527,7 @@ echo ""
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "1.2 - getopt with incorrect args" echo "1.2 - getopt with incorrect args"
@ -546,7 +546,7 @@ getopt="abc123"
fn_test_result_fail fn_test_result_fail
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "2.0 - install" echo "2.0 - install"
@ -563,7 +563,7 @@ echo "Command: ./jc2server auto-install"
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.1 - start" echo "3.1 - start"
@ -582,7 +582,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.2 - start - online" echo "3.2 - start - online"
@ -601,7 +601,7 @@ fn_setstatus
fn_test_result_fail fn_test_result_fail
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.3 - start - updateonstart" echo "3.3 - start - updateonstart"
@ -620,7 +620,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.4 - stop" echo "3.4 - stop"
@ -639,7 +639,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.5 - stop - offline" echo "3.5 - stop - offline"
@ -658,7 +658,7 @@ fn_setstatus
fn_test_result_fail fn_test_result_fail
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.6 - restart" echo "3.6 - restart"
@ -677,7 +677,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.7 - restart - offline" echo "3.7 - restart - offline"
@ -696,7 +696,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "4.1 - update" echo "4.1 - update"
echo "=================================" echo "================================="
@ -714,7 +714,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "4.2 - update - change buildid" echo "4.2 - update - change buildid"
@ -735,7 +735,7 @@ sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf"
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "4.3 - update - change buildid - online" echo "4.3 - update - change buildid - online"
@ -756,7 +756,7 @@ sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf"
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "4.4 - update - remove appmanifest file" echo "4.4 - update - remove appmanifest file"
@ -777,7 +777,7 @@ rm --verbose "${serverfiles}/steamapps/appmanifest_${appid}.acf"
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "4.5 - force-update" echo "4.5 - force-update"
@ -796,7 +796,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "4.6 - force-update - online" echo "4.6 - force-update - online"
@ -815,7 +815,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "4.7 - validate" echo "4.7 - validate"
@ -834,7 +834,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "4.8 - validate - online" echo "4.8 - validate - online"
@ -854,7 +854,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "Inserting IP address" echo "Inserting IP address"
@ -883,7 +883,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "5.2 - monitor - offline - with lockfile" echo "5.2 - monitor - offline - with lockfile"
@ -904,7 +904,7 @@ date > "${rootdir}/${lockselfname}"
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "5.3 - monitor - offline - no lockfile" echo "5.3 - monitor - offline - no lockfile"
@ -923,13 +923,13 @@ fn_setstatus
fn_test_result_fail fn_test_result_fail
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "5.4 - monitor - gsquery.py failure" echo "5.4 - monitor - query_gsquery.py failure"
echo "=================================" echo "================================="
echo "Description:" echo "Description:"
echo "gsquery.py will fail to query port." echo "query_gsquery.py will fail to query port."
echo "Command: ./jc2server monitor" echo "Command: ./jc2server monitor"
requiredstatus="ONLINE" requiredstatus="ONLINE"
fn_setstatus fn_setstatus
@ -944,7 +944,7 @@ sed -i 's/[0-9]\+/0/' "${servercfgfullpath}"
fn_test_result_fail fn_test_result_fail
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
fn_print_info_nl "Re-generating ${servercfg}." fn_print_info_nl "Re-generating ${servercfg}."
@ -968,7 +968,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "6.1 - post details" echo "6.1 - post details"
@ -987,7 +987,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "7.0 - backup" echo "7.0 - backup"
@ -1002,7 +1002,7 @@ echo "test de-activated until issue #1839 fixed"
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "8.0 - dev - detect glibc" echo "8.0 - dev - detect glibc"
@ -1021,7 +1021,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "8.1 - dev - detect ldd" echo "8.1 - dev - detect ldd"
@ -1040,7 +1040,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "8.2 - dev - detect deps" echo "8.2 - dev - detect deps"
@ -1059,7 +1059,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "=================================" echo "================================="

44
tests/tests_ts3server.sh

@ -475,7 +475,7 @@ echo ""
) )
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo"" echo""
echo "0.2 - Enable dev-debug" echo "0.2 - Enable dev-debug"
@ -487,7 +487,7 @@ echo ""
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo"" echo""
echo "1.0 - start - no files" echo "1.0 - start - no files"
@ -505,7 +505,7 @@ echo ""
fn_test_result_fail fn_test_result_fail
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "1.1 - getopt" echo "1.1 - getopt"
@ -523,7 +523,7 @@ echo ""
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "1.2 - getopt with incorrect args" echo "1.2 - getopt with incorrect args"
@ -542,7 +542,7 @@ getopt="abc123"
fn_test_result_fail fn_test_result_fail
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "2.0 - install" echo "2.0 - install"
@ -559,7 +559,7 @@ echo "Command: ./ts3server auto-install"
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.1 - start" echo "3.1 - start"
@ -578,7 +578,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.2 - start - online" echo "3.2 - start - online"
@ -613,7 +613,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.4 - stop" echo "3.4 - stop"
@ -632,7 +632,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.5 - stop - offline" echo "3.5 - stop - offline"
@ -651,7 +651,7 @@ fn_setstatus
fn_test_result_fail fn_test_result_fail
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.6 - restart" echo "3.6 - restart"
@ -670,7 +670,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "3.7 - restart - offline" echo "3.7 - restart - offline"
@ -689,7 +689,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "4.1 - update" echo "4.1 - update"
echo "=================================" echo "================================="
@ -707,7 +707,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "5.1 - monitor - online" echo "5.1 - monitor - online"
@ -726,7 +726,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "5.2 - monitor - offline - with lockfile" echo "5.2 - monitor - offline - with lockfile"
@ -747,7 +747,7 @@ date > "${rootdir}/${lockselfname}"
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "5.3 - monitor - offline - no lockfile" echo "5.3 - monitor - offline - no lockfile"
@ -766,7 +766,7 @@ fn_setstatus
fn_test_result_fail fn_test_result_fail
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "6.0 - details" echo "6.0 - details"
@ -785,7 +785,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "6.1 - post details" echo "6.1 - post details"
@ -804,7 +804,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "7.0 - backup" echo "7.0 - backup"
@ -819,7 +819,7 @@ echo "test de-activated until issue #1839 fixed"
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "8.0 - dev - detect glibc" echo "8.0 - dev - detect glibc"
@ -838,7 +838,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "8.1 - dev - detect ldd" echo "8.1 - dev - detect ldd"
@ -857,7 +857,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "8.2 - dev - detect deps" echo "8.2 - dev - detect deps"
@ -876,7 +876,7 @@ fn_setstatus
fn_test_result_pass fn_test_result_pass
echo "run order" echo "run order"
echo "=================" echo "================="
grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g' grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log"| sed 's/functionfile=//g'
echo "" echo ""
echo "=================================" echo "================================="

Loading…
Cancel
Save