Re: [gentoo-user] ip_change_notifier - empty IP address
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, the...@sys-concept.com 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.
Re: [gentoo-user] ip_change_notifier - empty IP address
Not quoting anything because I'm just making a general reply, to the general problem that you're generally trying to solve. Generally. You really should be using DNS for what you're trying to do, one way or the other. Reverse DNS, when set up properly, will always return the appropriate IP address for you. If this isn't achievable (I might scoff at a few dollars a year for a domain but others might not), then you should still be using DNS as a protocol, for both speed and reliability reasons. OpenDNS provides this a free service. dig +short myip.opendns.com @resolver1.opendns.com If you still don't want to use DNS for whatever reason, there are services that are designed for infrastructural reliability for this, namely: icanhazip.com [1] Since 2021 icanhazip is hosted by Cloudflare, and regardless of how you feel about CF as a company, the service is designed for speed and reliabilty for this exact purpose. 1: https://major.io/p/a-new-future-for-icanhazip/
Re: [gentoo-user] ip_change_notifier - empty IP address
On Wednesday, June 28, 2023 5:05:25 P.M. AEST Neil Bothwick wrote: > On Tue, 27 Jun 2023 18:49:55 -0600, the...@sys-concept.com 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 -- Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/ Asking for technical help in newsgroups? Read this first: http://catb.org/~esr/faqs/smart-questions.html#intro
Re: [gentoo-user] ip_change_notifier - empty IP address
On Tue, 27 Jun 2023 18:49:55 -0600, the...@sys-concept.com 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. -- Neil Bothwick Documentation: (n.) a novel sold with software, designed to entertain the operator during episodes of bugs or glitches. pgpoZAb5xmB6G.pgp Description: OpenPGP digital signature