Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
cf7334eb
Commit
cf7334eb
authored
Aug 27, 2020
by
Ed Lynes
Browse files
add alt nonce generation logic
parent
281ee1a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_edgedns.sh
View file @
cf7334eb
...
@@ -64,7 +64,7 @@ dns_edgedns_add() {
...
@@ -64,7 +64,7 @@ dns_edgedns_add() {
record_op
=
"PUT"
record_op
=
"PUT"
rdlist
=
"
${
_edge_result
#*\
"rdata
\"
:[}"
rdlist
=
"
${
_edge_result
#*\
"rdata
\"
:[}"
rdlist=
"
${
rdlist
%%]*
}
"
rdlist=
"
${
rdlist
%%]*
}
"
rdlist=
$(
echo
"
$rdlist
"
|
tr
-d
'"'
|
tr
-d
"
\\
"
)
rdlist=
$(
echo
"
$rdlist
"
|
tr
-d
'"'
|
tr
-d
"
\\
\\
"
)
_debug3
"existing TXT found"
_debug3
"existing TXT found"
_debug3
"record data"
"
$rdlist
"
_debug3
"record data"
"
$rdlist
"
# value already there?
# value already there?
...
@@ -132,7 +132,7 @@ dns_edgedns_rm() {
...
@@ -132,7 +132,7 @@ dns_edgedns_rm() {
# record already exists. Get existing record data and update
# record already exists. Get existing record data and update
rdlist="
${
_edge_result
#*\
"rdata
\"
:[}"
rdlist="
${
_edge_result
#*\
"rdata
\"
:[}"
rdlist=
"
${
rdlist
%%]*
}
"
rdlist=
"
${
rdlist
%%]*
}
"
rdlist=
$(
echo
"
$rdlist
"
|
tr
-d
'"'
|
tr
-d
"
\\
"
)
rdlist=
$(
echo
"
$rdlist
"
|
tr
-d
'"'
|
tr
-d
"
\\
\\
"
)
_debug3
"rdlist"
"
$rdlist
"
_debug3
"rdlist"
"
$rdlist
"
if [ -n
"
$rdlist
"
]; then
if [ -n
"
$rdlist
"
]; then
record_op=
"PUT"
record_op=
"PUT"
...
@@ -355,10 +355,16 @@ _edgedns_rest() {
...
@@ -355,10 +355,16 @@ _edgedns_rest() {
_edgedns_eg_timestamp
()
{
_edgedns_eg_timestamp
()
{
_eg_timestamp
=
$(
date
-u
"+%Y%m%dT%H:%M:%S+0000"
)
_eg_timestamp
=
$(
date
-u
"+%Y%m%dT%H:%M:%S+0000"
)
_debug3
"_eg_timestamp"
"
$_eg_timestamp
"
}
}
_edgedns_new_nonce
()
{
_edgedns_new_nonce
()
{
_nonce
=
$(
uuidgen
-r
)
_nonce
=
$(
uuidgen
-r
)
_ret
=
"
$?
"
if
[
"
$_ret
"
-ne
0
]
;
then
_nonce
=
$(
echo
"EDGEDNS
$(
_time
)
"
| _digest sha1 hex |
cut
-c
1-32
)
fi
_debug3
"_nonce"
"
$_nonce
"
}
}
_edgedns_make_auth_header
()
{
_edgedns_make_auth_header
()
{
...
...
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