فهرست منبع

Not chunking already manually chunked TXT records

dpeca 5 سال پیش
والد
کامیت
311827c4b3
1فایلهای تغییر یافته به همراه12 افزوده شده و 6 حذف شده
  1. 12 6
      func/domain.sh

+ 12 - 6
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