ddns-scripts: rename variable: s/ERR_UPDATE/RETRY_COUNT/

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 <rafal@milecki.pl>
pull/19470/head
Rafał Miłecki 2022-09-27 17:42:58 +02:00
parent a6247d81a9
commit 586e283a51
2 changed files with 5 additions and 5 deletions

View File

@ -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"

View File

@ -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