Browse Source

changes

pull/3015/head
Daniel Gibbs 5 years ago
parent
commit
9b56c093a1
  1. 7
      lgsm/functions/check_ip.sh
  2. 134
      lgsm/functions/command_dev_query_raw.sh

7
lgsm/functions/check_ip.sh

@ -8,6 +8,7 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
info_config.sh
info_distro.sh # for dev
info_parms.sh
if [ ! -f "/bin/ip" ]; then
@ -20,11 +21,11 @@ getipwc=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\
# Check if server has m ultiple IP addresses
# If the ip variable is set by user
if [ "${ip}" != "0.0.0.0" ]||[ "${ip}" != "" ]; then
queryip=( "${ip}" )
if [ "${ip}" != "0.0.0.0" ]&&[ "${ip}" != "" ]; then
queryips=( "${ip}" )
# If ip is not set by user
else
queryip=( "${getip}" )
queryips=( "${getip}" )
fi
echo "###### DEV IP CHECK ######"

134
lgsm/functions/command_dev_query_raw.sh

@ -13,74 +13,80 @@ check.sh
info_config.sh
info_parms.sh
echo -e ""
echo -e "Query Port - Raw Output"
echo -e "=================================================================="
echo -e ""
echo -e "Ports"
echo -e "================================="
echo -e ""
echo -e "PORT: ${port}"
echo -e "QUERY PORT: ${queryport}"
echo -e ""
echo -e "Gamedig Raw Output"
echo -e "================================="
echo -e ""
if [ ! "$(command -v gamedig 2>/dev/null)" ]; then
fn_print_failure_nl "gamedig not installed"
fi
if [ ! "$(command -v jq 2>/dev/null)" ]; then
fn_print_failure_nl "jq not installed"
fi
query_gamedig.sh
echo -e "${gamedigcmd}"
echo""
echo "${gamedigraw}" | jq
for queryip in "${queryips[@]}"
do
echo -e ""
echo -e "Query Port - Raw Output"
echo -e "=================================================================="
echo -e ""
echo -e "QUERY IP"
echo -e "${queryip}"
echo -e "================================="
echo -e "Ports"
echo -e "================================="
echo -e ""
echo -e "PORT: ${port}"
echo -e "QUERY PORT: ${queryport}"
echo -e ""
echo -e "Gamedig Raw Output"
echo -e "================================="
echo -e ""
if [ ! "$(command -v gamedig 2>/dev/null)" ]; then
fn_print_failure_nl "gamedig not installed"
fi
if [ ! "$(command -v jq 2>/dev/null)" ]; then
fn_print_failure_nl "jq not installed"
fi
echo -e ""
echo -e "gsquery Raw Output"
echo -e "================================="
echo -e ""
echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\""
echo -e ""
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 "${queryip}" -p "${queryport}" -e "${querytype}"
query_gamedig.sh
echo -e "${gamedigcmd}"
echo""
echo "${gamedigraw}" | jq
echo -e ""
echo -e "TCP Raw Output"
echo -e "================================="
echo -e ""
echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''"
echo -e ""
bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''
querystatus="$?"
echo -e ""
if [ "${querystatus}" == "0" ]; then
echo -e "TCP query PASS"
else
echo -e "TCP query FAIL"
fi
echo -e ""
echo -e "gsquery Raw Output"
echo -e "================================="
echo -e ""
echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\""
echo -e ""
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 "${queryip}" -p "${queryport}" -e "${querytype}"
echo -e ""
echo -e "Game Port - Raw Output"
echo -e "=================================================================="
echo -e ""
echo -e "TCP Raw Output"
echo -e "================================="
echo -e ""
echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''"
echo -e ""
bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''
querystatus="$?"
echo -e ""
if [ "${querystatus}" == "0" ]; then
echo -e "TCP query PASS"
else
echo -e "TCP query FAIL"
fi
echo -e ""
echo -e "TCP Raw Output"
echo -e "================================="
echo -e ""
echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''"
echo -e ""
bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''
querystatus="$?"
echo -e ""
if [ "${querystatus}" == "0" ]; then
echo -e "TCP query PASS"
else
echo -e "TCP query FAIL"
fi
echo -e ""
echo -e "Game Port - Raw Output"
echo -e "=================================================================="
echo -e ""
echo -e "TCP Raw Output"
echo -e "================================="
echo -e ""
echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''"
echo -e ""
bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''
querystatus="$?"
echo -e ""
if [ "${querystatus}" == "0" ]; then
echo -e "TCP query PASS"
else
echo -e "TCP query FAIL"
fi
done
exitcode=0
core_exit.sh

Loading…
Cancel
Save