mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-05 05:54:51 +08:00
Fix: spaces -> tabs
This commit is contained in:
parent
07b46c743b
commit
b43c3d9582
1 changed files with 19 additions and 19 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue