Browse Source

add detect details

pull/4200/head
Daniel Gibbs 3 years ago
parent
commit
eb2b313d7b
No known key found for this signature in database GPG Key ID: 7CA38B43F78F12FE
  1. 30
      lgsm/modules/command_dev_details.sh
  2. 3
      lgsm/modules/core_getopt.sh
  3. 5
      lgsm/modules/core_modules.sh
  4. 3
      lgsm/modules/info_game.sh

30
lgsm/modules/command_dev_details.sh

@ -0,0 +1,30 @@
#!/bin/bash
# LinuxGSM command_dev_debug.sh module
# Author: Daniel Gibbs
# Contributors: http://linuxgsm.com/contrib
# Website: https://linuxgsm.com
# Description: Dev only: Displays all parsed details.
echo -e ""
echo -e "${lightgreen}Details List${default}"
echo -e "=================================================================="
echo -e ""
echo -e "Game: ${gamename}"
echo -e "Short Name: ${shortname}"
echo -e "Directory: ${rootdir}"
echo -e "Binary: ${executable}"
echo -e "Config: ${servercfgfullpath}"
echo -e "Port: ${port}"
echo -e "Query Port: ${queryport}"
echo -e "Servername: ${servername}"
echo -e "Server Password: ${serverpassword}"
echo -e "RCON Password: ${rconpassword}"
echo -e "Admin Password: ${adminpassword}"
echo -e "Maxplayers: ${maxplayers}"
echo -e "Tickrate: ${tickrate}"
echo -e "Default Map: ${defaultmap}"
echo -e "Game Mode: ${gamemode}"
echo -e "RCON Enabled: ${rconenabled}"
echo -e "RCON Password: ${rconpassword}"
echo -e "Config IP: ${configip}"

3
lgsm/modules/core_getopt.sh

@ -50,6 +50,7 @@ cmd_install_squad_license=("li;license" "install_squad_license.sh" "Add your Squ
cmd_fastdl=("fd;fastdl" "command_fastdl.sh" "Build a FastDL directory.") cmd_fastdl=("fd;fastdl" "command_fastdl.sh" "Build a FastDL directory.")
# Dev commands. # Dev commands.
cmd_dev_debug=("dev;developer" "command_dev_debug.sh" "Enable developer Mode.") cmd_dev_debug=("dev;developer" "command_dev_debug.sh" "Enable developer Mode.")
cmd_dev_details=("ddt;detect-details" "command_dev_details.sh" "Display parsed details.")
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.")
@ -145,7 +146,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_query_raw[@]}" "${cmd_dev_clear_modules[@]}") currentopt+=("${cmd_dev_details[@]}" "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_modules[@]}")
fi fi
## Sponsor. ## Sponsor.

5
lgsm/modules/core_modules.sh

@ -299,6 +299,11 @@ command_dev_debug.sh() {
fn_fetch_module fn_fetch_module
} }
command_dev_details.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
command_dev_detect_deps.sh() { command_dev_detect_deps.sh() {
modulefile="${FUNCNAME[0]}" modulefile="${FUNCNAME[0]}"
fn_fetch_module fn_fetch_module

3
lgsm/modules/info_game.sh

@ -17,6 +17,7 @@ modulesselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Config Type: ini # Config Type: ini
# Comment: ; or # # Comment: ; or #
# Note: this ini filter does not filter by section. Can cause issues with some games that have multiple sections with the same variable name.
fn_info_game_ini() { fn_info_game_ini() {
# sed is used to process the file. # sed is used to process the file.
# -n option tells sed to suppress output by default. # -n option tells sed to suppress output by default.
@ -28,7 +29,7 @@ fn_info_game_ini() {
if [ -n "${3}" ]; then if [ -n "${3}" ]; then
servercfgfullpath="${3}" servercfgfullpath="${3}"
fi fi
eval "${1}"="$(sed -n "/^[[:space:]]*${2}/ { s/.*= *//p; q }" "${servercfgfullpath}")" eval "${1}"="$(sed -n "/^[[:space:]]*\<${2}\>/ { s/.*= *//p;q }" "${servercfgfullpath}")"
} }
# Config Type: QuakeC # Config Type: QuakeC

Loading…
Cancel
Save