Fix: spaces -> tabs

This commit is contained in:
Bojan Čekrlić 2025-02-28 18:59:22 +01:00
parent 07b46c743b
commit b43c3d9582

View file

@ -289,28 +289,28 @@ convert_plugin_names_to_filter_names() {
# that at least one works # that at least one works
################################################################### ###################################################################
get_public_ip() { get_public_ip() {
local services=(https://ipinfo.io/ip https://ifconfig.me/ip https://icanhazip.com https://ipecho.net/ip https://ifconfig.co https://myexternalip.com/raw) local services=(https://ipinfo.io/ip https://ifconfig.me/ip https://icanhazip.com https://ipecho.net/ip https://ifconfig.co https://myexternalip.com/raw)
local ip local ip
if [[ -n "${AUTOSET_HOSTNAME_SERVICES}" ]]; then if [[ -n "${AUTOSET_HOSTNAME_SERVICES}" ]]; then
services=("${AUTOSET_HOSTNAME_SERVICES}") services=("${AUTOSET_HOSTNAME_SERVICES}")
notice "Using user defined ${emphasis}AUTOSET_HOSTNAME_SERVICES${reset}=${emphasis}${AUTOSET_HOSTNAME_SERVICES}${reset} for IP detection" notice "Using user defined ${emphasis}AUTOSET_HOSTNAME_SERVICES${reset}=${emphasis}${AUTOSET_HOSTNAME_SERVICES}${reset} for IP detection"
else else
debug "Public IP detection will use ${emphasis}${services}${reset} to detect the IP." debug "Public IP detection will use ${emphasis}${services}${reset} to detect the IP."
fi fi
for service in "${services[@]}"; do for service in "${services[@]}"; do
if ip="$(curl --fail-early --retry-max-time 30 --retry 10 --connect-timeout 5 --max-time 10 -s)"; then if ip="$(curl --fail-early --retry-max-time 30 --retry 10 --connect-timeout 5 --max-time 10 -s)"; then
# Some services, such as ifconfig.co will return a line feed at the end of the response. # Some services, such as ifconfig.co will return a line feed at the end of the response.
ip="$(printf "%s" "${ip}" | trim)" ip="$(printf "%s" "${ip}" | trim)"
if [[ -n "${ip}" ]]; then if [[ -n "${ip}" ]]; then
info "Detected public IP address as ${emphasis}${services}${ip}${reset}." info "Detected public IP address as ${emphasis}${services}${ip}${reset}."
break break
fi fi
fi fi
done done
error "Unable to detect public IP. Please check your internet connection and firewall settings." error "Unable to detect public IP. Please check your internet connection and firewall settings."
return 1 return 1
} }
export reset green yellow orange orange_emphasis lightblue red gray emphasis underline export reset green yellow orange orange_emphasis lightblue red gray emphasis underline