mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-09 02:22:44 +00:00
Configurationless nsupdate -l
-like mode
When `nsupdate -l` works, `-dnsapi nsupdate` requires no further configuration. It does not use `nsupdate -l` (would imply more code and more code changes), but points `nsupdate -k` at the key which would be used by `nsupdate -l`.
This commit is contained in:
parent
cae6c8e5f5
commit
16e6a55d4b
@ -100,6 +100,10 @@ https://github.com/Neilpang/acme.sh/wiki/How-to-use-OVH-domain-api
|
|||||||
|
|
||||||
## 7. Use nsupdate to automatically issue cert
|
## 7. Use nsupdate to automatically issue cert
|
||||||
|
|
||||||
|
If `nsupdate -l` already works for the domain in question, you are all set:
|
||||||
|
neither preparation nor environment variables are required.
|
||||||
|
Otherwise, follow these instructions:
|
||||||
|
|
||||||
First, generate a key for updating the zone
|
First, generate a key for updating the zone
|
||||||
```
|
```
|
||||||
b=$(dnssec-keygen -a hmac-sha512 -b 512 -n USER -K /tmp foo)
|
b=$(dnssec-keygen -a hmac-sha512 -b 512 -n USER -K /tmp foo)
|
||||||
|
@ -7,7 +7,6 @@ dns_nsupdate_add() {
|
|||||||
fulldomain=$1
|
fulldomain=$1
|
||||||
txtvalue=$2
|
txtvalue=$2
|
||||||
_checkKeyFile || return 1
|
_checkKeyFile || return 1
|
||||||
[ -n "${NSUPDATE_SERVER}" ] || NSUPDATE_SERVER="localhost"
|
|
||||||
# save the dns server and key to the account conf file.
|
# save the dns server and key to the account conf file.
|
||||||
_saveaccountconf NSUPDATE_SERVER "${NSUPDATE_SERVER}"
|
_saveaccountconf NSUPDATE_SERVER "${NSUPDATE_SERVER}"
|
||||||
_saveaccountconf NSUPDATE_KEY "${NSUPDATE_KEY}"
|
_saveaccountconf NSUPDATE_KEY "${NSUPDATE_KEY}"
|
||||||
@ -29,7 +28,6 @@ EOF
|
|||||||
dns_nsupdate_rm() {
|
dns_nsupdate_rm() {
|
||||||
fulldomain=$1
|
fulldomain=$1
|
||||||
_checkKeyFile || return 1
|
_checkKeyFile || return 1
|
||||||
[ -n "${NSUPDATE_SERVER}" ] || NSUPDATE_SERVER="localhost"
|
|
||||||
_info "removing ${fulldomain}. txt"
|
_info "removing ${fulldomain}. txt"
|
||||||
nsupdate -k "${NSUPDATE_KEY}" <<EOF
|
nsupdate -k "${NSUPDATE_KEY}" <<EOF
|
||||||
server ${NSUPDATE_SERVER}
|
server ${NSUPDATE_SERVER}
|
||||||
@ -47,6 +45,10 @@ EOF
|
|||||||
#################### Private functions below ##################################
|
#################### Private functions below ##################################
|
||||||
|
|
||||||
_checkKeyFile() {
|
_checkKeyFile() {
|
||||||
|
[ -n "${NSUPDATE_SERVER}" ] || NSUPDATE_SERVER="localhost"
|
||||||
|
if [ "${NSUPDATE_SERVER}" = "localhost" -a -z "${NSUPDATE_KEY}" ]; then
|
||||||
|
NSUPDATE_KEY=/var/run/named/session.key
|
||||||
|
fi
|
||||||
if [ -z "${NSUPDATE_KEY}" ]; then
|
if [ -z "${NSUPDATE_KEY}" ]; then
|
||||||
_err "you must specify a path to the nsupdate key file"
|
_err "you must specify a path to the nsupdate key file"
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user