From: Liangbin Lian Date: Wed, 4 Jun 2025 09:22:03 +0000 (+0800) Subject: ddns-scripts: fix parsing of parameters for cloudflare.com X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=150d88585bafec6f9579a753da0da59fe4bee1fc;p=openwrt-packages.git ddns-scripts: fix parsing of parameters for cloudflare.com Compatible with domain without the `@` symbol, consistent with the previous. Fixes 8c55d089 ("ddns-scripts: fix parsing of parameters for cloudflare.com") Signed-off-by: Liangbin Lian --- diff --git a/net/ddns-scripts/Makefile b/net/ddns-scripts/Makefile index ed41fc88d..d6a6fe3ab 100644 --- a/net/ddns-scripts/Makefile +++ b/net/ddns-scripts/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ddns-scripts PKG_VERSION:=2.8.2 -PKG_RELEASE:=71 +PKG_RELEASE:=72 PKG_LICENSE:=GPL-2.0 diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh b/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh index ee4b7183a..17cd7c024 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh @@ -30,12 +30,16 @@ local __HOST __DOMAIN __TYPE __URLBASE __PRGBASE __RUNPROG __DATA __IPV6 __ZONEID __RECID local __URLBASE="https://api.cloudflare.com/client/v4" -# split __HOST __DOMAIN from $domain -# given data: -# @example.com for "domain record" -# host.sub@example.com for a "host record" -__HOST=$(printf %s "$domain" | cut -d@ -f1) -__DOMAIN=$(printf %s "$domain" | cut -d@ -f2) +if echo "$domain" | grep -Fq '@'; then + # split __HOST __DOMAIN from $domain + # given data: + # @example.com for "domain record" + # host.sub@example.com for a "host record" + __HOST=$(printf %s "$domain" | cut -d@ -f1) + __DOMAIN=$(printf %s "$domain" | cut -d@ -f2) +else + __DOMAIN=$domain +fi # Cloudflare v4 needs: # __DOMAIN = the base domain i.e. example.com