From 26f76e4e79d507cd404cd4eb2e335205c541261d Mon Sep 17 00:00:00 2001 From: CZECHIA-COM Date: Thu, 26 Feb 2026 16:36:25 +0100 Subject: [PATCH] Update dns_czechia.sh --- dnsapi/dns_czechia.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/dnsapi/dns_czechia.sh b/dnsapi/dns_czechia.sh index c0fc7701..ae670eb2 100644 --- a/dnsapi/dns_czechia.sh +++ b/dnsapi/dns_czechia.sh @@ -85,26 +85,24 @@ _czechia_load_conf() { _czechia_pick_zone() { _fd_input="$1" _debug "Vstupni domena: $_fd_input" - _debug "Dostupne zony: $CZ_Zones" + _debug "Dostupne zony: $CZ_Zones" _fd=$(echo "$_fd_input" | _lower_case | sed 's/\.$//') _best_zone="" - # Replace comma with space using sed (Docker safe) _zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g') for _z in $_zones_space; do - # Remove spaces and trailing dot, then lowercase - NO 'tr' used here _clean_z=$(echo "$_z" | _lower_case | sed 's/ //g; s/\.$//') [ -z "$_clean_z" ] && continue case "$_fd" in - "$_clean_z" | *".$_clean_z") - # Compare length using native shell ${#var} - Docker/BusyBox safe - if [ ${#_clean_z} -gt ${#_best_zone} ]; then - _best_zone="$_clean_z" - fi - ;; + "$_clean_z" | *".$_clean_z") + if [ ${#_clean_z} -gt ${#_best_zone} ]; then + _best_zone="$_clean_z" + fi + ;; esac - done + done # <--- TADY TI TO CHYBĚLO (před printf) + [ -n "$_best_zone" ] && printf "%s" "$_best_zone" }