Browse Source

merge info_parms and info_config into info_game.sh

a
pull/3428/head
Daniel Gibbs 4 years ago
parent
commit
93ea16b5b1
  1. 2
      lgsm/functions/alert.sh
  2. 3
      lgsm/functions/check_ip.sh
  3. 2
      lgsm/functions/command_debug.sh
  4. 3
      lgsm/functions/command_details.sh
  5. 3
      lgsm/functions/command_dev_query_raw.sh
  6. 3
      lgsm/functions/command_monitor.sh
  7. 3
      lgsm/functions/command_postdetails.sh
  8. 2
      lgsm/functions/command_restart.sh
  9. 2
      lgsm/functions/command_start.sh
  10. 2
      lgsm/functions/command_stop.sh
  11. 2
      lgsm/functions/command_test_alert.sh
  12. 7
      lgsm/functions/core_functions.sh
  13. 568
      lgsm/functions/info_game.sh
  14. 337
      lgsm/functions/info_parms.sh
  15. 2
      lgsm/functions/query_gamedig.sh
  16. 2
      tests/tests_fctrserver.sh
  17. 2
      tests/tests_jc2server.sh
  18. 2
      tests/tests_mcserver.sh
  19. 2
      tests/tests_ts3server.sh

2
lgsm/functions/alert.sh

@ -11,7 +11,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Used with email alerts.
fn_alert_log(){
info_distro.sh
info_config.sh
info_game.sh
info_messages.sh
if [ -f "${alertlog}" ]; then
rm -f "${alertlog:?}"

3
lgsm/functions/check_ip.sh

@ -8,8 +8,7 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
info_config.sh
info_parms.sh
info_game.sh
if [ ! -f "/bin/ip" ]; then
ipcommand="/sbin/ip"

2
lgsm/functions/command_debug.sh

@ -27,7 +27,7 @@ fn_lockfile_trap(){
check.sh
fix.sh
info_distro.sh
info_config.sh
info_game.sh
# NOTE: Check if works with server without parms. Could be intergrated in to info_parms.sh.
fn_print_header
{

3
lgsm/functions/command_details.sh

@ -13,8 +13,7 @@ fn_firstcommand_set
# Run checks and gathers details to display.
check.sh
info_distro.sh
info_config.sh
info_parms.sh
info_game.sh
info_messages.sh
if [ "${querymode}" == "2" ]||[ "${querymode}" == "3" ]; then
for queryip in "${queryips[@]}"; do

3
lgsm/functions/command_dev_query_raw.sh

@ -11,8 +11,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
check.sh
info_config.sh
info_parms.sh
info_game.sh
info_distro.sh
info_messages.sh

3
lgsm/functions/command_monitor.sh

@ -225,8 +225,7 @@ fn_monitor_loop(){
monitorflag=1
check.sh
core_logs.sh
info_config.sh
info_parms.sh
info_game.sh
# query pre-checks
fn_monitor_check_lockfile

3
lgsm/functions/command_postdetails.sh

@ -31,8 +31,7 @@ if [ "${exitbypass}" ]; then
else
# Run checks and gathers details to display.
check.sh
info_config.sh
info_parms.sh
info_game.sh
info_distro.sh
info_messages.sh
for queryip in "${queryips[@]}"

2
lgsm/functions/command_restart.sh

@ -10,7 +10,7 @@ commandaction="Restarting"
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
info_config.sh
info_game.sh
exitbypass=1
command_stop.sh
command_start.sh

2
lgsm/functions/command_start.sh

@ -191,7 +191,7 @@ fi
if [ -z "${fixbypass}" ]; then
fix.sh
fi
info_config.sh
info_game.sh
core_logs.sh
# Will check for updates is updateonstart is yes.

2
lgsm/functions/command_stop.sh

@ -269,7 +269,7 @@ fn_stop_pre_check(){
check.sh
fn_print_dots "${servername}"
info_config.sh
info_game.sh
fn_stop_pre_check
# Remove lockfile.
if [ -f "${lockdir}/${selfname}.lock" ]; then

2
lgsm/functions/command_test_alert.sh

@ -12,7 +12,7 @@ fn_firstcommand_set
fn_print_dots "${servername}"
check.sh
info_config.sh
info_game.sh
alert="test"
alert.sh

7
lgsm/functions/core_functions.sh

@ -513,7 +513,7 @@ functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
info_config.sh(){
info_game.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
@ -533,11 +533,6 @@ functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
info_parms.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
# Alert
alert.sh(){

568
lgsm/functions/info_config.sh → lgsm/functions/info_game.sh

File diff suppressed because it is too large

337
lgsm/functions/info_parms.sh

@ -1,337 +0,0 @@
#!/bin/bash
# LinuxGSM info_parms.sh module
# Author: Daniel Gibbs
# Contributors: http://linuxgsm.com/contrib
# Website: https://linuxgsm.com
# Description: If specific parms are not set then this will be displayed in details.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
unavailable="${red}UNAVAILABLE${default}"
zero="${red}0${default}"
fn_info_parms_ark(){
port=${port:-"0"}
queryport=${queryport:-"0"}
rconport=${rconport:-"0"}
rawport=$((port+1))
maxplayers=${maxplayers:-"0"}
}
fn_info_parms_bt(){
port=${port:-"0"}
queryport=${queryport:-"0"}
}
fn_info_parms_bt1944(){
port=${port:-"0"}
rconport=$((port+2))
queryport=${queryport:-"0"}
}
fn_info_parms_cod(){
defaultmap=${defaultmap:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
port=${port:-"0"}
queryport=${port:-"0"}
}
fn_info_parms_dst(){
sharding=${sharding:-"NOT SET"}
master=${master:-"NOT SET"}
shard=${shard:-"NOT SET"}
cluster=${cluster:-"NOT SET"}
cave=${cave:-"NOT SET"}
}
fn_info_parms_fctr(){
port=${port:-"0"}
rconport=${rconport:-"0"}
rconpassword=${rconpassword:-"NOT SET"}
}
fn_info_parms_hurtworld(){
servername=${servername:-"NOT SET"}
port=${port:-"0"}
queryport=${queryport:-"0"}
maxplayers=${maxplayers:-"0"}
defaultmap=${defaultmap:-"NOT SET"}
creativemode=${creativemode:-"NOT SET"}
}
fn_info_parms_inss(){
port=${port:-"0"}
queryport=${queryport:-"0"}
rconport=${rconport:-"0"}
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
defaultmap=${defaultmap:-"NOT SET"}
defaultscenario=${defaultscenario:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
}
fn_info_parms_kf2(){
queryport=${queryport:-"0"}
defaultmap=${defaultmap:-"NOT SET"}
}
fn_info_parms_mh(){
port=${port:-"0"}
queryport=${queryport:-"0"}
beaconport=${beaconport:-"0"}
}
fn_info_parms_mohaa(){
port=${port:-"0"}
queryport=${port:-"0"}
defaultmap=${defaultmap:-"NOT SET"}
}
fn_info_parms_mom(){
port=${port:-"7777"}
beaconport=${queryport:-"15000"}
}
fn_info_parms_mta(){
queryport=$((port+123))
}
fn_info_parms_pz(){
adminpassword=${adminpassword:-"NOT SET"}
queryport=${port:-"0"}
}
fn_info_parms_qw(){
port=${port:-"0"}
queryport=${port:-"0"}
}
fn_info_parms_quake2(){
port=${port:-"0"}
queryport=${port:-"0"}
defaultmap=${defaultmap:-"NOT SET"}
}
fn_info_parms_arma3(){
port=${port:-"2302"}
voiceport=${port:-"2302"}
queryport=$((port+1))
steammasterport=$((port+2))
voiceunusedport=$((port+3))
battleeyeport=$((port+4))
}
fn_info_parms_rw(){
servername=${servername:-"NOT SET"}
port=${port:-"0"}
httpqueryport=$((port-1))
}
fn_info_parms_rtcw(){
port=${port:-"0"}
queryport=${port:-"0"}
defaultmap=${defaultmap:-"NOT SET"}
}
fn_info_parms_rust(){
servername=${servername:-"NOT SET"}
port=${port:-"0"}
queryport=${port:-"0"}
appport=${appport:-"0"}
rconport=${rconport:-"0"}
gamemode=${gamemode:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
rconpassword=${rconpassword:-"NOT SET"}
rconweb=${rconweb:-"NOT SET"}
tickrate=${tickrate:-"0"}
saveinterval=${saveinterval:-"0"}
serverlevel=${serverlevel:-"NOT SET"}
worldsize=${worldsize:-"0"}
}
fn_info_parms_samp(){
queryport=${port:-"0"}
}
fn_info_parms_source(){
defaultmap=${defaultmap:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
port=${port:-"0"}
rconport=${port:-"0"}
queryport=${port:-"0"}
clientport=${clientport:-"0"}
# Steamport can be between 26901-26910 and is normaly automaticly set.
# Some servers might support -steamport parameter to set
if [ "${steamport}" == "0" ]||[ -z "${steamport}" ]; then
steamport="$(echo "${ssinfo}" | grep "${srcdslinuxpid}" | awk '{print $5}' | grep ":269" | cut -d ":" -f2)"
fi
steamport="${steamport:-"0"}"
}
fn_info_parms_spark(){
defaultmap=${defaultmap:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
port=${port:-"0"}
queryport=$((port+1))
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
webadminuser=${webadminuser:-"NOT SET"}
webadminpass=${webadminpass:-"NOT SET"}
webadminport=${webadminport:-"0"}
# Commented out as displaying not set in details parameters
#mods=${mods:-"NOT SET"}
}
fn_info_parms_st(){
port=${port:-"0"}
queryport=${queryport:-"0"}
httpport=${port:-"0"}
worldtype=${worldtype:-"NOT SET"}
autosaveinterval=${autosaveinterval:-"0"}
clearinterval=${clearinterval:-"0"}
worldname=${worldname:-"NOT SET"}
}
fn_info_parms_sbots(){
port=${port:-"0"}
queryport=${queryport:-"0"}
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
defaultmap=${defaultmap:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
}
fn_info_parms_sof2(){
port=${port:-"0"}
queryport=${port:-"0"}
defaultmap=${defaultmap:-"NOT SET"}
}
fn_info_parms_tu(){
port=${port:-"0"}
steamport=$((port+1))
queryport=${queryport:-"0"}
}
fn_info_parms_pvr(){
port=${port:-"0"}
port401=$((port+400))
queryport=${port:-"0"}
}
fn_info_parms_unreal(){
defaultmap=${defaultmap:-"NOT SET"}
queryport=$((port+1))
}
fn_info_parms_unreal2(){
defaultmap=${defaultmap:-"NOT SET"}
queryport=$((port+1))
}
fn_info_parms_ut3(){
port=${port:-"0"}
queryport=${queryport:-"0"}
defaultmap=${defaultmap:-"NOT SET"}
}
fn_info_parms_unt(){
servername=${selfname:-"NOT SET"}
port=${port:-"0"}
queryport=$((port+1))
}
fn_info_parms_ut(){
port=${port:-"0"}
queryport=$((port+1))
}
fn_info_parms_vh(){
port=${port:-"0"}
if [ "${public}" != "0" ]; then
queryport=$((port+1))
else
querymode="1"
fi
gameworld=${gameworld:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
servername=${servername:-"NOT SET"}
}
fn_info_parms_wf(){
port=${port:-"0"}
queryport="${port:-"0"}"
webadminport=${webadminport:-"0"}
}
fn_info_parms_queryport(){
queryport="${port:-"0"}"
}
if [ "${shortname}" == "ark" ]; then
fn_info_parms_ark
elif [ "${shortname}" == "arma3" ]; then
fn_info_parms_arma3
elif [ "${shortname}" == "bt" ]; then
fn_info_parms_bt
elif [ "${shortname}" == "bt1944" ]; then
fn_info_parms_bt1944
elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${engine}" == "iw2.0" ]||[ "${engine}" == "iw3.0" ]; then
fn_info_parms_cod
elif [ "${shortname}" == "fctr" ]; then
fn_info_parms_fctr
elif [ "${shortname}" == "inss" ]; then
fn_info_parms_inss
elif [ "${shortname}" == "kf2" ]; then
fn_info_parms_kf2
elif [ "${shortname}" == "mh" ]; then
fn_info_parms_mh
elif [ "${shortname}" == "mohaa" ]; then
fn_info_parms_mohaa
elif [ "${shortname}" == "mom" ]; then
fn_info_parms_mom
elif [ "${shortname}" == "mta" ]; then
fn_info_parms_mta
elif [ "${shortname}" == "pvr" ]; then
fn_info_parms_pvr
elif [ "${shortname}" == "pz" ]; then
fn_info_parms_pz
elif [ "${shortname}" == "q2" ]||[ "${shortname}" == "q3" ]; then
fn_info_parms_quake2
elif [ "${shortname}" == "qw" ]; then
fn_info_parms_qw
elif [ "${shortname}" == "rtcw" ]; then
fn_info_parms_rtcw
elif [ "${shortname}" == "rust" ]; then
fn_info_parms_rust
elif [ "${shortname}" == "rw" ]; then
fn_info_parms_rw
elif [ "${shortname}" == "st" ]; then
fn_info_parms_st
elif [ "${shortname}" == "sof2" ]; then
fn_info_parms_sof2
elif [ "${shortname}" == "sbots" ]; then
fn_info_parms_sbots
elif [ "${shortname}" == "tu" ]; then
fn_info_parms_tu
elif [ "${shortname}" == "ut3" ]; then
fn_info_parms_ut3
elif [ "${shortname}" == "unt" ]; then
fn_info_parms_unt
elif [ "${shortname}" == "ut" ]; then
fn_info_parms_ut
elif [ "${shortname}" == "vh" ]; then
fn_info_parms_vh
elif [ "${shortname}" == "wf" ]; then
fn_info_parms_wf
elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then
fn_info_parms_source
elif [ "${engine}" == "spark" ]; then
fn_info_parms_spark
elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
fn_info_parms_unreal
# for servers that have a missing queryport from the game config.
elif [ "${shortname}" == "samp" ]||[ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]||[ "${shortname}" == "jk2" ]||[ "${shortname}" == "tw" ]; then
fn_info_parms_queryport
fi

2
lgsm/functions/query_gamedig.sh

@ -30,7 +30,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ];
fi
if [ "${querytype}" == "teamspeak3" ]; then
fn_info_config_teamspeak3
fn_info_game_ts3
fi
# server name.

2
tests/tests_fctrserver.sh

@ -923,7 +923,7 @@ echo -e ""
echo -e "5.0 - Monitor Tests"
echo -e "=================================================================="
echo -e ""
info_config.sh
info_game.sh
echo -e "Server IP - Port: ${ip}:${port}"
echo -e "Server IP - Query Port: ${ip}:${queryport}"

2
tests/tests_jc2server.sh

@ -1082,7 +1082,7 @@ echo -e ""
echo -e "5.0 - Monitor Tests"
echo -e "=================================================================="
echo -e ""
info_config.sh
info_game.sh
echo -e "Server IP - Port: ${ip}:${port}"
echo -e "Server IP - Query Port: ${ip}:${queryport}"

2
tests/tests_mcserver.sh

@ -945,7 +945,7 @@ echo -e ""
echo -e "5.0 - Monitor Tests"
echo -e "=================================================================="
echo -e ""
info_config.sh
info_game.sh
echo -e "Server IP - Port: ${ip}:${port}"
echo -e "Server IP - Query Port: ${ip}:${queryport}"

2
tests/tests_ts3server.sh

@ -922,7 +922,7 @@ echo -e ""
echo -e "5.0 - Monitor Tests"
echo -e "=================================================================="
echo -e ""
info_config.sh
info_game.sh
echo -e "Server IP - Port: ${ip}:${port}"
echo -e "Server IP - Query Port: ${ip}:${queryport}"

Loading…
Cancel
Save