Use ipv4.api.cloudron.io endpoint for IPv4 detection

This commit is contained in:
Girish Ramakrishnan
2022-01-04 22:14:53 -08:00
parent 15d0dd93f4
commit 531a6fe0dc
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ printf "**********************************************************************\n
if [[ -z "$(ls -A /home/yellowtent/platformdata/addons/mail/dkim)" ]]; then
if [[ -f /tmp/.cloudron-motd-cache ]]; then
ip=$(cat /tmp/.cloudron-motd-cache)
elif ! ip=$(curl --fail --connect-timeout 2 --max-time 2 -q https://api.cloudron.io/api/v1/helper/public_ip | sed -n -e 's/.*"ip": "\(.*\)"/\1/p'); then
elif ! ip=$(curl --fail --connect-timeout 2 --max-time 2 -q https://ipv4.api.cloudron.io/api/v1/helper/public_ip | sed -n -e 's/.*"ip": "\(.*\)"/\1/p'); then
ip='<IP>'
fi
echo "${ip}" > /tmp/.cloudron-motd-cache