Browse Source

ddns-scripts: send_update() detection private IPv4

correction of excluding private IPv4 in send_update() function.
Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
lilik-openwrt-22.03
Christian Schoenebeck 10 years ago
parent
commit
178510d421
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh

+ 3
- 3
net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh View File

@ -552,9 +552,9 @@ send_update() {
# $1 # IP to set at DDNS service provider
local __IP __URL __ANSWER __ERR
# verify given IP
[ $use_ipv6 -eq 0 ] && __IP=$(echo $1 | grep -v -E "(^0|^10\.|^127|^172|^192)") # no private IPv4's
[ $use_ipv6 -eq 1 ] && __IP=$(echo $1 | grep "^[0-9a-eA-E]") # no IPv6 addr starting with fxxx of with ":"
# verify given IP / no private IPv4's / no IPv6 addr starting with fxxx of with ":"
[ $use_ipv6 -eq 0 ] && __IP=$(echo $1 | grep -v -E "(^0|^10\.|^127|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-1]\.|^192\.168)")
[ $use_ipv6 -eq 1 ] && __IP=$(echo $1 | grep "^[0-9a-eA-E]")
[ -z "$__IP" ] && critical_error "Invalid or no IP '$1' given"
# do replaces in URL


Loading…
Cancel
Save