mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-24 22:21:40 +00:00
Changed lastUsedRidForDomainEntry seperator to space
This commit is contained in:
parent
f3e77a989c
commit
f9320fff8f
@ -20,7 +20,7 @@ dns_selfhost_add() {
|
|||||||
SELFHOSTDNS_MAP="${SELFHOSTDNS_MAP:-$(_readdomainconf SELFHOSTDNS_MAP)}"
|
SELFHOSTDNS_MAP="${SELFHOSTDNS_MAP:-$(_readdomainconf SELFHOSTDNS_MAP)}"
|
||||||
# Selfhost api can't dynamically add TXT record,
|
# Selfhost api can't dynamically add TXT record,
|
||||||
# so we have to store the last used RID of the domain to support a second RID for wildcard domains
|
# so we have to store the last used RID of the domain to support a second RID for wildcard domains
|
||||||
# (format: ';fulldomainA:lastRid;;fulldomainB:lastRid;...')
|
# (format: 'fulldomainA:lastRid fulldomainB:lastRid ...')
|
||||||
SELFHOSTDNS_MAP_LAST_USED_INTERNAL=$(_readdomainconf SELFHOSTDNS_MAP_LAST_USED_INTERNAL)
|
SELFHOSTDNS_MAP_LAST_USED_INTERNAL=$(_readdomainconf SELFHOSTDNS_MAP_LAST_USED_INTERNAL)
|
||||||
|
|
||||||
if [ -z "${SELFHOSTDNS_USERNAME:-}" ] || [ -z "${SELFHOSTDNS_PASSWORD:-}" ]; then
|
if [ -z "${SELFHOSTDNS_USERNAME:-}" ] || [ -z "${SELFHOSTDNS_PASSWORD:-}" ]; then
|
||||||
@ -44,21 +44,26 @@ dns_selfhost_add() {
|
|||||||
rid2=$(echo "$mapEntry" | cut -d: -f3)
|
rid2=$(echo "$mapEntry" | cut -d: -f3)
|
||||||
|
|
||||||
# read last used rid domain
|
# read last used rid domain
|
||||||
lastUsedRidForDomainEntry=$(echo "$SELFHOSTDNS_MAP_LAST_USED_INTERNAL" | sed -n -E "s/.*(;$fulldomain:[[:digit:]]+;).*/\1/p")
|
lastUsedRidForDomainEntry=$(echo "$SELFHOSTDNS_MAP_LAST_USED_INTERNAL" | sed -n -E "s/(^|^.*[[:space:]])($fulldomain:[[:digit:]]+)(.*)/\2/p")
|
||||||
_debug2 lastUsedRidForDomainEntry "$lastUsedRidForDomainEntry"
|
_debug2 lastUsedRidForDomainEntry "$lastUsedRidForDomainEntry"
|
||||||
lastUsedRidForDomain=$(echo "$lastUsedRidForDomainEntry" | tr -d ";" | cut -d: -f2)
|
lastUsedRidForDomain=$(echo "$lastUsedRidForDomainEntry" | cut -d: -f2)
|
||||||
|
|
||||||
rid="$rid1"
|
rid="$rid1"
|
||||||
if [ "$lastUsedRidForDomain" = "$rid" ] && ! test -z "$rid2"; then
|
if [ "$lastUsedRidForDomain" = "$rid" ] && ! test -z "$rid2"; then
|
||||||
rid="$rid2"
|
rid="$rid2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
newLastUsedRidForDomainEntry="$fulldomain:$rid"
|
||||||
if ! test -z "$lastUsedRidForDomainEntry"; then
|
if ! test -z "$lastUsedRidForDomainEntry"; then
|
||||||
# replace last used rid entry for domain
|
# replace last used rid entry for domain
|
||||||
SELFHOSTDNS_MAP_LAST_USED_INTERNAL=$(echo "$SELFHOSTDNS_MAP_LAST_USED_INTERNAL" | sed -n -E "s/$lastUsedRidForDomainEntry/;$fulldomain:$rid;/p")
|
SELFHOSTDNS_MAP_LAST_USED_INTERNAL=$(echo "$SELFHOSTDNS_MAP_LAST_USED_INTERNAL" | sed -n -E "s/$lastUsedRidForDomainEntry/$newLastUsedRidForDomainEntry/p")
|
||||||
else
|
else
|
||||||
# add last used rid entry for domain
|
# add last used rid entry for domain
|
||||||
SELFHOSTDNS_MAP_LAST_USED_INTERNAL="$SELFHOSTDNS_MAP_LAST_USED_INTERNAL"";$fulldomain:$rid;"
|
if test -z "$SELFHOSTDNS_MAP_LAST_USED_INTERNAL"; then
|
||||||
|
SELFHOSTDNS_MAP_LAST_USED_INTERNAL="$newLastUsedRidForDomainEntry"
|
||||||
|
else
|
||||||
|
SELFHOSTDNS_MAP_LAST_USED_INTERNAL="$SELFHOSTDNS_MAP_LAST_USED_INTERNAL $newLastUsedRidForDomainEntry"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_info "Trying to add $txt on selfhost for rid: $rid"
|
_info "Trying to add $txt on selfhost for rid: $rid"
|
||||||
|
Loading…
Reference in New Issue
Block a user