The path for the PEM file will be stored with the domain configuration and will be available when renewing, so that deploy will happen automatically when renewed.
if! _rest POST "Record.Create""user_token=$DPI_Id,$DPI_Key&format=json&domain_id=$_domain_id&sub_domain=$_sub_domain&record_type=TXT&value=$txtvalue&record_line=default";then
return 1
fi
_contains "$response""Action completed successful"|| _contains "$response""Domain record already exists"