From 311827c4b315dc2e0db0c86cf2bdca07417742e2 Mon Sep 17 00:00:00 2001 From: dpeca Date: Wed, 19 Aug 2020 14:52:45 +0200 Subject: [PATCH] Not chunking already manually chunked TXT records --- func/domain.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/func/domain.sh b/func/domain.sh index fc615e7b..ad3b8a82 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -416,13 +416,19 @@ update_domain_zone() { if [ "$TYPE" = 'TXT' ]; then txtlength=${#VALUE} if [ $txtlength -gt 255 ]; then - if [[ ${VALUE:0:1} = '"' ]]; then - txtlength=$(( $txtlength - 2 )) - VALUE=${VALUE:1:txtlength} + already_chunked=0 + if [[ $VALUE == *"\" \""* ]]; then + already_chunked=1 + fi + if [ $already_chunked -eq 0 ]; then + if [[ ${VALUE:0:1} = '"' ]]; then + txtlength=$(( $txtlength - 2 )) + VALUE=${VALUE:1:txtlength} + fi + VALUE=$(echo $VALUE | fold -w 255 | xargs -I '$' echo -n ' "$"') + VALUE=${VALUE:1} + VALUE="($VALUE)" fi - VALUE=$(echo $VALUE | fold -w 255 | xargs -I '$' echo -n ' "$"') - VALUE=${VALUE:1} - VALUE="($VALUE)" fi fi