Use CHAOS TXT local.api.txt instead of trying to parse pihole-FTL --config webserver.ports

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2023-12-01 09:10:06 +01:00
parent 6016131280
commit 96bf07863f
No known key found for this signature in database
GPG key ID: 00135ACBD90B28DD
2 changed files with 47 additions and 49 deletions

View file

@ -121,14 +121,14 @@ Main(){
# or b) for the /search endpoint (webserver.api.searchAPIauth) no authentication is required.
# Therefore, we try to query directly without authentication but do authenticat if 401 is returned
data=$(GetFTLData "/search/${domain}?N=${max_results}&partial=${partial}")
data=$(GetFTLData "search/${domain}?N=${max_results}&partial=${partial}")
if [ "${data}" = 401 ]; then
# Unauthenticated, so authenticate with the FTL server required
Authenthication
Authentication
# send query again
data=$(GetFTLData "/search/${domain}?N=${max_results}&partial=${partial}")
data=$(GetFTLData "search/${domain}?N=${max_results}&partial=${partial}")
fi
GenerateOutput "${data}"