Skip to content

Commit

Permalink
Limit curl execution time to 2s to find WAN IP
Browse files Browse the repository at this point in the history
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 #7753

Signed-off-by: Uladzimir Bely <wiselord1983@gmail.com>
  • Loading branch information
WiseLord authored and igorpecovnik committed Jan 27, 2025
1 parent 9b82282 commit 12d6d07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/bsp/common/etc/update-motd.d/10-armbian-header
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 12d6d07

Please # to comment.