Limit curl execution time to 2s to find WAN IP

Option "--connect-timeout" used to determine external IP covers only
connection phase. Curl may "hans" in a different phase and this makes
login to the system impossible if MOTD "header" module enabled.

Using "--max-time" is more reliable and prevents hanging for hours.

Fixes issue https://github.com/armbian/build/issues/7753

Signed-off-by: Uladzimir Bely <wiselord1983@gmail.com>
This commit is contained in:
Uladzimir Bely
2025-01-27 11:26:11 +03:00
committed by Igor
parent 9b822824bb
commit 12d6d070ba

View File

@@ -56,7 +56,7 @@ for f in $MOTD_DISABLE; do
done
function get_wan_address() {
curl --connect-timeout 2 -s http://whatismyip.akamai.com/
curl --max-time 2 -s http://whatismyip.akamai.com/
} # get wan ip address
function get_ip_addresses() {