ddns-scripts: fix parsing of parameters for cloudflare.com
authorLiangbin Lian <[email protected]>
Tue, 16 Apr 2024 03:24:31 +0000 (11:24 +0800)
committerFlorian Eckert <[email protected]>
Tue, 27 May 2025 06:05:06 +0000 (08:05 +0200)
There is an obvious bug here:
if we want to update example.com.example.com in zone example.com,
so `[email protected]`, after parsing,
the `__HOST` will be `example.com`, not expected `example.com.example.com`.

Signed-off-by: Liangbin Lian <[email protected]>
net/ddns-scripts/Makefile
net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh

index ab9382fb17b8ed08604850f48a835c38e7a2d28b..ed41fc88d9ae874c7ea376effb46ef73376e8217 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ddns-scripts
 PKG_VERSION:=2.8.2
-PKG_RELEASE:=70
+PKG_RELEASE:=71
 
 PKG_LICENSE:=GPL-2.0
 
index d65db5885510b696f2ca0a41037cf6e6bc149fbe..ee4b7183a6983b228d6d4c8415728a3333c4ddaf 100644 (file)
@@ -42,10 +42,13 @@ __DOMAIN=$(printf %s "$domain" | cut -d@ -f2)
 # __HOST   = the FQDN of record to modify
 # i.e. example.com for the "domain record" or host.sub.example.com for "host record"
 
+if [ -z "$__HOST" ]; then
 # handling domain record then set __HOST = __DOMAIN
-[ -z "$__HOST" ] && __HOST=$__DOMAIN
+       __HOST=$__DOMAIN
+else
 # handling host record then rebuild fqdn [email protected] => host.domain.tld
-[ "$__HOST" != "$__DOMAIN" ] && __HOST="${__HOST}.${__DOMAIN}"
+       __HOST="${__HOST}.${__DOMAIN}"
+fi
 
 # set record type
 [ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"