On 6/28/23 01:23, Paul Colquhoun wrote:
On Wednesday, June 28, 2023 5:05:25 P.M. AEST Neil Bothwick wrote:
On Tue, 27 Jun 2023 18:49:55 -0600, [email protected] wrote:
# Query the API to get the current IP address
NEW_IP=$(get_ip_address)
# Retry if the IP address is empty
retry_count=0
while [[ -z "$NEW_IP" && $retry_count -lt 3 ]]; do
sleep 1
NEW_IP=$(get_ip_address)
((retry_count++))
done
That's better, although I would use a longer sleep to allow for network
issues.
# Retry if the IP address is empty
retry_count=0
while [[ -z "$NEW_IP" && $retry_count -lt 3 ]]; do
((retry_count++))
sleep $retry_count
NEW_IP=$(get_ip_address)
done
Thank you, no more empty IP in txt file.