I'm writing a script to automate Let's Encrypt in PowerDNS,(this is a simple bash shell script to be run on debian)
Certbot runs and calls the script, feeding to it the variable: $CERTBOT_VALIDATION
I read a thread already here which shows the need for '"content"'
– notice the single quote '
and the double quote "
. (i've tried this in a different iteration of the code to no avail)
I'm struggling to output the expanded variable inside quotes, here is one way i tried:
pdnsutil add-record Example.com _acme-challenge txt 120 "\"%s\"" "$CERTBOT_VALIDATION"
However, to output that from bash, I must add a \
before the "
.
I want the output command to be as follows:
pdnsutil add-record Example.com _acme-challenge txt 120 "content"
What is the best way to do this?
whatever is currently being output is erroring with:
Error: Parsing record content (try 'pdnsutil check-zone'): Data field in DNS should start with quote (") at position 0 of ''yXtgt_2vlnrF7j2V-eTJZuSjXbswsGN97TQ0Zp3IynM''