mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 02:28:03 -07:00
Split long TXT entries into 255 chunks
This commit is contained in:
parent
ccea621787
commit
f74301b19f
1 changed files with 14 additions and 0 deletions
|
@ -412,6 +412,20 @@ update_domain_zone() {
|
|||
VALUE=$(idn --quiet -a -t "$VALUE")
|
||||
fi
|
||||
|
||||
# Split long TXT entries into 255 chunks
|
||||
if [ "$TYPE" = 'TXT' ]; then
|
||||
txtlength=${#VALUE}
|
||||
if [ $txtlength -gt 255 ]; 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
|
||||
fi
|
||||
|
||||
if [ "$SUSPENDED" != 'yes' ]; then
|
||||
eval echo -e "\"$fields\""|sed "s/%quote%/'/g" >> $zn_conf
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue