Browse Source

Update dns_czechia.sh

Fix _czechia_rel_host() structure
pull/6764/head
CZECHIA-COM 1 month ago
committed by neil
parent
commit
3a1250958a
  1. 36
      dnsapi/dns_czechia.sh

36
dnsapi/dns_czechia.sh

@ -142,10 +142,10 @@ _czechia_pick_zone() {
if [ -n "$CZ_Zone" ]; then if [ -n "$CZ_Zone" ]; then
z="$CZ_Zone" z="$CZ_Zone"
case "$fd" in case "$fd" in
"$z" | *".$z")
best="$z"
bestlen=${#z}
;;
"$z" | *".$z")
best="$z"
bestlen=${#z}
;;
esac esac
fi fi
@ -157,12 +157,12 @@ _czechia_pick_zone() {
z="$(printf "%s" "$z" | sed 's/^ *//; s/ *$//; s/\.$//')" z="$(printf "%s" "$z" | sed 's/^ *//; s/ *$//; s/\.$//')"
[ -z "$z" ] && continue [ -z "$z" ] && continue
case "$fd" in case "$fd" in
"$z" | *".$z")
if [ "${#z}" -gt "$bestlen" ]; then
best="$z"
bestlen=${#z}
fi
;;
"$z" | *".$z")
if [ "${#z}" -gt "$bestlen" ]; then
best="$z"
bestlen=${#z}
fi
;;
esac esac
done done
IFS="$oldifs" IFS="$oldifs"
@ -194,18 +194,22 @@ _czechia_rel_host() {
suffix=".$z" suffix=".$z"
case "$fd" in case "$fd" in
*"$suffix")
rel="${fd%"$suffix"}"
[ -z "$rel" ] && rel="@"
echo "$rel"
return 0
;;
*"$suffix")
rel="${fd%"$suffix"}"
[ -z "$rel" ] && rel="@"
echo "$rel"
return 0
;;
esac esac
_err "fulldomain '$fd' is not under zone '$z'" _err "fulldomain '$fd' is not under zone '$z'"
return 1 return 1
} }
_err "fulldomain '$fd' is not under zone '$z'"
return 1
}
_czechia_build_body() { _czechia_build_body() {
host="$1" host="$1"
txt="$2" txt="$2"

Loading…
Cancel
Save