Skip to content
Permalink
Browse files

feat(query-raw): add TCP/UDP query to game port (#2341)

  • Loading branch information...
dgibbs64 committed May 7, 2019
1 parent 378d8f0 commit ab48c0b7f05c732b1486a85ff865ed5df7e1282c
Showing with 39 additions and 11 deletions.
  1. +39 −11 lgsm/functions/command_dev_query_raw.sh
@@ -7,8 +7,10 @@
local commandname="QUERY-RAW"
local commandaction="Query Raw"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

echo "================================="
echo ""
echo "Query Port"
echo "=================================================================="
echo ""
echo "Gamedig Raw Output"
echo "================================="
echo""
@@ -33,7 +35,6 @@ echo "${gamedigcmd}"
echo""
echo "${gamedigraw}" | jq
echo""
echo "================================="
echo "gsquery Raw Output"
echo "================================="
echo""
@@ -44,29 +45,56 @@ fi
"${functionsdir}"/query_gsquery.py -a "${ip}" -p "${queryport}" -e "${engine}"

echo""
echo "================================="
echo "tcp Raw Output"
echo "TCP Raw Output"
echo "================================="
echo""
echo "bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''"
bash -c 'exec 3<> /dev/tcp/'${ip}'/'${queryport}''
querystatus="$?"
if [ "${querystatus}" == "0" ]; then
echo "tcp query PASS"
echo "TCP query PASS"
else
echo "tcp query FAIL"
echo "TCP query FAIL"
fi

echo""
echo "================================="
echo "udp Raw Output"
echo "UDP Raw Output"
echo "================================="
echo""
echo "bash -c 'exec 3<> /dev/udp/'${ip}'/'${queryport}''"
bash -c 'exec 3<> /dev/udp/'${ip}'/'${queryport}''
querystatus="$?"
if [ "${querystatus}" == "0" ]; then
echo "udp query PASS"
echo "UPD query PASS"
else
echo "UPD query FAIL"
fi
echo ""
echo "Game Port"
echo "=================================================================="
echo ""
echo""
echo "TCP Raw Output"
echo "================================="
echo""
echo "bash -c 'exec 3<> /dev/tcp/'${ip}'/'${port}''"
bash -c 'exec 3<> /dev/tcp/'${ip}'/'${port}''
querystatus="$?"
if [ "${querystatus}" == "0" ]; then
echo "TCP query PASS"
else
echo "TCP query FAIL"
fi

echo""
echo "UDP Raw Output"
echo "================================="
echo""
echo "bash -c 'exec 3<> /dev/udp/'${ip}'/'${port}''"
bash -c 'exec 3<> /dev/udp/'${ip}'/'${port}''
querystatus="$?"
if [ "${querystatus}" == "0" ]; then
echo "UDP query PASS"
else
echo "udp query FAIL"
echo "UDP query FAIL"
fi

0 comments on commit ab48c0b

Please sign in to comment.
You can’t perform that action at this time.