|
@@ -213,36 +213,75 @@ fi
|
213
|
213
|
verbose_echo " waiting =: 10 seconds for interfaces to fully come up"
|
214
|
214
|
sleep 10
|
215
|
215
|
|
216
|
|
-
|
217
|
|
-[ -n "$dns_server" ] && {
|
218
|
|
- verbose_echo "******* VERIFY =: DNS server '$dns_server'"
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+ERR_VERIFY=0
|
|
220
|
+while [ -n "$dns_server" ]; do
|
|
221
|
+ [ $ERR_VERIFY -eq 0 ] && verbose_echo "******* VERIFY =: DNS server '$dns_server'"
|
219
|
222
|
verify_dns "$dns_server"
|
220
|
|
- case $? in
|
221
|
|
- 0) ;;
|
222
|
|
- 2) critical_error "Invalid DNS server Error: '2' - nslookup can not resolve host";;
|
223
|
|
- 3) critical_error "Invalid DNS server Error: '3' - nc (netcat) can not connect";;
|
224
|
|
- 4) critical_error "Invalid DNS server Error: '4' - Forced IP Version don't matched";;
|
225
|
|
- *) critical_error "Invalid DNS server Error: '1' - unspecific error";;
|
|
223
|
+ ERR_LAST=$?
|
|
224
|
+ [ $ERR_LAST -eq 0 ] && break
|
|
225
|
+ ERR_VERIFY=$(( $ERR_VERIFY + 1 ))
|
|
226
|
+
|
|
227
|
+ [ $ERR_VERIFY -gt $retry_count ] && {
|
|
228
|
+ case $ERR_LAST in
|
|
229
|
+ 2) critical_error "Invalid DNS server Error: '2' - nslookup can not resolve host";;
|
|
230
|
+ 3) critical_error "Invalid DNS server Error: '3' - nc (netcat) can not connect";;
|
|
231
|
+ *) critical_error "Invalid DNS server Error: '$ERR_LAST' - unspecific error";;
|
|
232
|
+ esac
|
|
233
|
+ }
|
|
234
|
+ case $ERR_LAST in
|
|
235
|
+ 2) syslog_err "Invalid DNS server Error: '2' - nslookup can not resolve host - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
|
|
236
|
+ 3) syslog_err "Invalid DNS server Error: '3' - nc (netcat) can not connect - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
|
|
237
|
+ *) syslog_err "Invalid DNS server Error: '$ERR_LAST' - unspecific error - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
|
226
|
238
|
esac
|
227
|
|
-}
|
|
239
|
+ [ $VERBOSE_MODE -gt 1 ] && {
|
|
240
|
+
|
|
241
|
+ verbose_echo "\n!!!!!!!!! ERROR =: Verbose Mode - NO retry\n"
|
|
242
|
+ break
|
|
243
|
+ }
|
|
244
|
+ verbose_echo "******** RETRY =: DNS server '$dns_server' - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds"
|
|
245
|
+ sleep $RETRY_SECONDS
|
|
246
|
+done
|
228
|
247
|
|
229
|
248
|
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+ERR_VERIFY=0
|
230
|
252
|
[ -n "$proxy" ] && {
|
231
|
|
- verbose_echo "******* VERIFY =: Proxy server 'http://$proxy'"
|
|
253
|
+ [ $ERR_VERIFY -eq 0 ] && verbose_echo "******* VERIFY =: Proxy server 'http://$proxy'"
|
232
|
254
|
verify_proxy "$proxy"
|
233
|
|
- case $? in
|
234
|
|
- 0)
|
235
|
|
- export HTTP_PROXY="http://$proxy"
|
236
|
|
- export HTTPS_PROXY="http://$proxy"
|
237
|
|
- export http_proxy="http://$proxy"
|
238
|
|
- export https_proxy="http://$proxy"
|
239
|
|
- ;;
|
240
|
|
- 2) critical_error "Invalid Proxy server Error: '2' - nslookup can not resolve host";;
|
241
|
|
- 3) critical_error "Invalid Proxy server Error: '3' - nc (netcat) can not connect";;
|
242
|
|
- 4) critical_error "Invalid Proxy server Error: '4' - Forced IP Version don't matched";;
|
243
|
|
- 5) critical_error "Invalid Proxy server Error: '5' - proxy port missing";;
|
244
|
|
- *) critical_error "Invalid Proxy server Error: '1' - unspecific error";;
|
|
255
|
+ ERR_LAST=$?
|
|
256
|
+ [ $ERR_LAST -eq 0 ] && {
|
|
257
|
+
|
|
258
|
+ export HTTP_PROXY="http://$proxy"
|
|
259
|
+ export HTTPS_PROXY="http://$proxy"
|
|
260
|
+ export http_proxy="http://$proxy"
|
|
261
|
+ export https_proxy="http://$proxy"
|
|
262
|
+ break
|
|
263
|
+ }
|
|
264
|
+ ERR_VERIFY=$(( $ERR_VERIFY + 1 ))
|
|
265
|
+
|
|
266
|
+ [ $ERR_VERIFY -gt $retry_count ] && {
|
|
267
|
+ case $ERR_LAST in
|
|
268
|
+ 2) critical_error "Invalid Proxy server Error '2' - nslookup can not resolve host";;
|
|
269
|
+ 3) critical_error "Invalid Proxy server Error '3' - nc (netcat) can not connect";;
|
|
270
|
+ *) critical_error "Invalid Proxy server Error '$ERR_LAST' - unspecific error";;
|
|
271
|
+ esac
|
|
272
|
+ }
|
|
273
|
+ case $ERR_LAST in
|
|
274
|
+ 2) syslog_err "Invalid Proxy server Error '2' - nslookup can not resolve host - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
|
|
275
|
+ 3) syslog_err "Invalid Proxy server Error '3' - nc (netcat) can not connect - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
|
|
276
|
+ *) syslog_err "Invalid Proxy server Error '$ERR_LAST' - unspecific error - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
|
245
|
277
|
esac
|
|
278
|
+ [ $VERBOSE_MODE -gt 1 ] && {
|
|
279
|
+
|
|
280
|
+ verbose_echo "\n!!!!!!!!! ERROR =: Verbose Mode - NO retry\n"
|
|
281
|
+ break
|
|
282
|
+ }
|
|
283
|
+ verbose_echo "******** RETRY =: Proxy server 'http://$proxy' - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds"
|
|
284
|
+ sleep $RETRY_SECONDS
|
246
|
285
|
}
|
247
|
286
|
|
248
|
287
|
|
|
@@ -304,7 +343,7 @@ while : ; do
|
304
|
343
|
if [ $VERBOSE_MODE -gt 2 ]; then
|
305
|
344
|
verbose_echo " VERBOSE MODE =: NO UPDATE send to DDNS provider"
|
306
|
345
|
elif [ "$LOCAL_IP" != "$REGISTERED_IP" ]; then
|
307
|
|
- verbose_echo "******* UPDATE =: LOCAL: '$LOCAL_IP' <=> REGISTERED: '$REGISTERED_IP'"
|
|
346
|
+ verbose_echo "******* UPDATE =: LOCAL: '$LOCAL_IP' <> REGISTERED: '$REGISTERED_IP'"
|
308
|
347
|
else
|
309
|
348
|
verbose_echo "******* FORCED =: LOCAL: '$LOCAL_IP' == REGISTERED: '$REGISTERED_IP'"
|
310
|
349
|
fi
|