From 586e283a51d41a1e36640265a0ddce42f130485e Mon Sep 17 00:00:00 2001 From: Rafał Miłecki Date: Tue, 27 Sep 2022 17:42:58 +0200 Subject: ddns-scripts: rename variable: s/ERR_UPDATE/RETRY_COUNT/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename variable to make code easier to understand. This variable specifies how many times in row ddns script tried to update IP without a success. Previous name ("ERR_UPDATE") didn't suggest it was for counting anything. It also didn't specify was error was it related to. Signed-off-by: Rafał Miłecki --- net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh | 2 +- net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'net/ddns-scripts/files/usr/lib/ddns') diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh index af2ef32ae..ea1b2a7ac 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh @@ -57,7 +57,7 @@ URL_PENC="" # url encoded $param_enc from config file UPD_ANSWER="" # Answer given by service on success ERR_LAST=0 # used to save $? return code of program and function calls -ERR_UPDATE=0 # error counter on different current and registered IPs +RETRY_COUNT=0 # error counter on different current and registered IPs PID_SLEEP=0 # ProcessID of current background "sleep" diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh index 210d7339b..a51ad5114 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh @@ -411,10 +411,10 @@ while : ; do # IP's are still different if [ "$CURRENT_IP" != "$REGISTERED_IP" ]; then if [ $VERBOSE -le 1 ]; then # VERBOSE <=1 then retry - ERR_UPDATE=$(( $ERR_UPDATE + 1 )) - [ $retry_max_count -gt 0 -a $ERR_UPDATE -gt $retry_max_count ] && \ + RETRY_COUNT=$(( $RETRY_COUNT + 1 )) + [ $retry_max_count -gt 0 -a $RETRY_COUNT -gt $retry_max_count ] && \ write_log 14 "Updating IP at DDNS provider failed after $retry_max_count retries" - write_log 4 "Updating IP at DDNS provider failed - starting retry $ERR_UPDATE/$retry_max_count" + write_log 4 "Updating IP at DDNS provider failed - starting retry $RETRY_COUNT/$retry_max_count" continue # loop to beginning else write_log 4 "Updating IP at DDNS provider failed" @@ -422,7 +422,7 @@ while : ; do fi else # we checked successful the last update - ERR_UPDATE=0 # reset error counter + RETRY_COUNT=0 # reset error counter fi # force_update=0 or VERBOSE > 1 - leave here -- cgit v1.2.3