command_dev_query_raw.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. # command_dev_query_raw.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://linuxgsm.com
  5. # Description: Raw gamedig output of the server.
  6. local commandname="QUERY-RAW"
  7. local commandaction="QUERY-RAW"
  8. local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  9. echo "================================="
  10. echo "Gamedig Raw Output"
  11. echo "================================="
  12. echo""
  13. if [ ! "$(command -v gamedig 2>/dev/null)" ]; then
  14. fn_print_failure_nl "gamedig not installed"
  15. fi
  16. if [ ! "$(command -v jq 2>/dev/null)" ]; then
  17. fn_print_failure_nl "jq not installed"
  18. fi
  19. check.sh
  20. info_config.sh
  21. info_parms.sh
  22. if [ "${engine}" == "idtech3_ql" ]; then
  23. local engine="quakelive"
  24. elif [ "${gamename}" == "Killing Floor 2" ]; then
  25. local engine="unreal4"
  26. fi
  27. query_gamedig.sh
  28. echo "gamedig --type \"${gamedigengine}\" --host \"${ip}\" --query_port \"${queryport}\"|jq"
  29. echo""
  30. echo "${gamedigraw}" | jq
  31. echo""
  32. echo "================================="
  33. echo "gsquery Raw Output"
  34. echo "================================="
  35. echo""
  36. echo "./query_gsquery.py -a \"${ip}\" -p \"${queryport}\" -e \"${engine}\""
  37. if [ ! -f "${functionsdir}/query_gsquery.py" ]; then
  38. fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nomd5"
  39. fi
  40. "${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${engine}"