mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-26 14:50:17 +00:00
Trim leading and trailing spaces and tabs in upstream servers (if any)
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
cc333f79cc
commit
c785667efe
1 changed files with 4 additions and 2 deletions
|
@ -553,6 +553,9 @@ gravity_DownloadBlocklistFromUrl() {
|
|||
upstream="${upstream%%,*}"
|
||||
upstream="${upstream##*[}"
|
||||
upstream="${upstream%%]*}"
|
||||
# Trim leading and trailing spaces and tabs
|
||||
upstream="${upstream#"${upstream%%[![:space:]]*}"}"
|
||||
upstream="${upstream%"${upstream##*[![:space:]]}"}"
|
||||
|
||||
# Get IP address and port of this upstream server
|
||||
local ip_addr port
|
||||
|
@ -567,8 +570,7 @@ gravity_DownloadBlocklistFromUrl() {
|
|||
port=443;
|
||||
else port=80
|
||||
fi
|
||||
bad_list=$(pihole -q -adlist "${domain}" | head -n1 | awk -F 'Match found in ' '{print $2}')
|
||||
echo -e "${OVER} ${CROSS} ${str} ${domain} is blocked by ${bad_list%:}. Using DNS on ${upstream} to download ${url}";
|
||||
echo -e "${OVER} ${CROSS} ${str} ${domain} is blocked by one of your lists. Using DNS server ${upstream} instead";
|
||||
echo -ne " ${INFO} ${str} Pending..."
|
||||
cmd_ext="--resolve $domain:$port:$ip"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue