Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
7a1f94bc
Commit
7a1f94bc
authored
Aug 28, 2022
by
AlvinSchiller
Browse files
set newLastUsedRidForDomainEntry after request was successfull
parent
f9320fff
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_selfhost.sh
View file @
7a1f94bc
...
@@ -53,6 +53,17 @@ dns_selfhost_add() {
...
@@ -53,6 +53,17 @@ dns_selfhost_add() {
rid
=
"
$rid2
"
rid
=
"
$rid2
"
fi
fi
_info
"Trying to add
$txt
on selfhost for rid:
$rid
"
data
=
"?username=
$SELFHOSTDNS_USERNAME
&password=
$SELFHOSTDNS_PASSWORD
&rid=
$rid
&content=
$txt
"
response
=
"
$(
_get
"
$SELFHOSTDNS_UPDATE_URL$data
"
)
"
if
!
echo
"
$response
"
|
grep
"200 OK"
>
/dev/null
;
then
_err
"Invalid response of acme-dns for selfhost"
return
1
fi
# write last used rid domain
newLastUsedRidForDomainEntry
=
"
$fulldomain
:
$rid
"
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
...
@@ -66,16 +77,6 @@ dns_selfhost_add() {
...
@@ -66,16 +77,6 @@ dns_selfhost_add() {
fi
fi
fi
fi
_info
"Trying to add
$txt
on selfhost for rid:
$rid
"
data
=
"?username=
$SELFHOSTDNS_USERNAME
&password=
$SELFHOSTDNS_PASSWORD
&rid=
$rid
&content=
$txt
"
response
=
"
$(
_get
"
$SELFHOSTDNS_UPDATE_URL$data
"
)
"
if
!
echo
"
$response
"
|
grep
"200 OK"
>
/dev/null
;
then
_err
"Invalid response of acme-dns for selfhost"
return
1
fi
# Now that we know the values are good, save them
# Now that we know the values are good, save them
_saveaccountconf_mutable SELFHOSTDNS_USERNAME
"
$SELFHOSTDNS_USERNAME
"
_saveaccountconf_mutable SELFHOSTDNS_USERNAME
"
$SELFHOSTDNS_USERNAME
"
_saveaccountconf_mutable SELFHOSTDNS_PASSWORD
"
$SELFHOSTDNS_PASSWORD
"
_saveaccountconf_mutable SELFHOSTDNS_PASSWORD
"
$SELFHOSTDNS_PASSWORD
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment