Skip to content

Commit 0d59057

Browse files
authored
Merge pull request #119 from TS3Tools/Issue-118-Fix-incorrect-gathered-ServerQuery-IP
Issue #118: Fix gathering of ServerQuery IP/Port when unexpected chars are included
2 parents 75723c8 + b72e898 commit 0d59057

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

TS3UpdateScript

+3-3
Original file line numberDiff line numberDiff line change
@@ -879,10 +879,10 @@ function getServerQueryIP() {
879879
fi
880880

881881
if [[ -n "$SERVER_QUERY_IP" ]]; then
882-
if [[ "$SERVER_QUERY_IP" == "0.0.0.0" ]]; then
882+
if [[ "$SERVER_QUERY_IP" =~ 0\.0\.0\.0 ]]; then
883883
echo -n "127.0.0.1";
884884
else
885-
echo -n "$SERVER_QUERY_IP";
885+
echo -n "$SERVER_QUERY_IP" | grep -Eo "([0-9]+[.]){3}[0-9]+";
886886
fi
887887
else
888888
echo -n "127.0.0.1";
@@ -897,7 +897,7 @@ function getServerQueryPort() {
897897
SERVER_QUERY_PORT="$(grep -E '^query_port=[0-9]{4,5}$' < ${1}/ts3server.ini | cut -d '=' -f 2)"
898898

899899
if [[ -n "$SERVER_QUERY_PORT" ]]; then
900-
echo -n "$SERVER_QUERY_PORT";
900+
echo -n "$SERVER_QUERY_PORT" | grep -Eo "([0-9]+)";
901901
else
902902
echo -n "10011";
903903
fi

docs/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ Hotfix | Important fix for one more issues, which causes a not (correct) working
2323

2424
## Releases
2525

26+
### Version 6.0.3 (2022-12-02)
27+
28+
* Issue #118: Fix gathering of ServerQuery IP and port when unexpected characters are included
29+
2630
### Version 6.0.2 (2022-11-23)
2731

2832
+ Implement check for downloaded TeamSpeak server files

0 commit comments

Comments
 (0)