|
|
@@ -18,7 +18,14 @@ for queryattempt in {1..5}; do
|
|
|
fn_print_dots "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: "
|
|
|
fn_print_querying_eol
|
|
|
fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : QUERYING"
|
|
|
- if [ "${querymethod}" == "gamedig" ]; then
|
|
|
+ if [ "$(cat "${rootdir}/${lockselfname}")" > "$(date "+%s" -d "${querydelay} mins ago")" ]; then
|
|
|
+ fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: "
|
|
|
+ fn_print_delay_eol
|
|
|
+ fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY"
|
|
|
+ fn_script_log_info "Query bypassed: ${gameservername} started less than ${querydelay} minute ago"
|
|
|
+ monitorpass=1
|
|
|
+ core_exit.sh
|
|
|
+ elif [ "${querymethod}" == "gamedig" ]; then
|
|
|
query_gamedig.sh
|
|
|
elif [ "${querymethod}" == "gsquery" ]; then
|
|
|
if [ ! -f "${functionsdir}/query_gsquery.py" ]; then
|
|
|
@@ -184,6 +191,17 @@ info_parms.sh
|
|
|
fn_monitor_check_lockfile
|
|
|
fn_monitor_check_update
|
|
|
fn_monitor_check_session
|
|
|
+
|
|
|
+# Fix if lockfile is not unix time or contains letters
|
|
|
+if [[ "$(cat "${rootdir}/${lockselfname}")" =~ [A-Za-z] ]]; then
|
|
|
+ date '+%s' > "${rootdir}/${lockselfname}"
|
|
|
+fi
|
|
|
+
|
|
|
+# Add a query bypass if missing
|
|
|
+if [ -z "${querydelay}" ]; then
|
|
|
+ querydelay="1"
|
|
|
+fi
|
|
|
+
|
|
|
# Query has to be enabled in Starbound config.
|
|
|
if [ "${shortname}" == "sb" ]; then
|
|
|
if [ "${queryenabled}" == "true" ]; then
|
|
|
@@ -194,4 +212,5 @@ elif [ "${shortname}" == "ts3" ]||[ "${shortname}" == "eco" ]||[ "${shortname}"
|
|
|
else
|
|
|
fn_monitor_query
|
|
|
fi
|
|
|
+
|
|
|
core_exit.sh
|