The external program is called with specific arguments depending on the EXEC_MODE setting. The first argument is always the action: present (to add the record) or cleanup (to remove the record).
Default Mode (EXEC_MODE=none)
In the default mode, the program receives the action, the fully-qualified domain name (FQDN), and the record value.
Command Pattern:
- Present:
myprogram present <FQDN> <record> - Cleanup:
myprogram cleanup <FQDN> <record>
RAW Mode (EXEC_MODE=RAW)
When EXEC_MODE is set to RAW, the program receives the action, a -- delimiter (to prevent tokens starting with - from being parsed as flags), the raw domain, the token, and the key-auth value.
Command Pattern:
- Present:
myprogram present -- <domain> <token> <key_auth> - Cleanup:
myprogram cleanup -- <domain> <token> <key_auth>
Note: The program must return a non-zero exit code to signal an error, which will cause the ACME process to abort.
### Default Mode Example
# Command: ./update-dns.sh "present" "_acme-challenge.my.example.org." "MsijOYZxqyjGnFGwhjrhfg-Xgbl5r68WPda0J9EgqqI"
### RAW Mode Example
# Command: ./update-dns.sh "present" "--" "my.example.org." "some-token" "KxAy-J3NwUmg9ZQuM-gP_Mq1nStaYSaP9tYQs5_-YsE.ksT-qywTd8058G-SHHWA3RAN72Pr0yWtPYmmY5UBpQ8"