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
a22d3b23
Unverified
Commit
a22d3b23
authored
Oct 28, 2019
by
scottkof
Committed by
GitHub
Oct 28, 2019
Browse files
Switch from `sleep` to `_sleep`
parent
df357521
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_aws.sh
View file @
a22d3b23
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#AWS_SECRET_ACCESS_KEY="xxxxxxx"
#AWS_SECRET_ACCESS_KEY="xxxxxxx"
#This is the Amazon Route53 api wrapper for acme.sh
#This is the Amazon Route53 api wrapper for acme.sh
#All `sleep` commands are included to avoid Route53 throttling, see
#All `
_
sleep` commands are included to avoid Route53 throttling, see
#https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-requests
#https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-requests
AWS_HOST
=
"route53.amazonaws.com"
AWS_HOST
=
"route53.amazonaws.com"
...
@@ -45,7 +45,7 @@ dns_aws_add() {
...
@@ -45,7 +45,7 @@ dns_aws_add() {
_debug
"First detect the root zone"
_debug
"First detect the root zone"
if
!
_get_root
"
$fulldomain
"
;
then
if
!
_get_root
"
$fulldomain
"
;
then
_err
"invalid domain"
_err
"invalid domain"
sleep
1
_
sleep 1
return
1
return
1
fi
fi
_debug _domain_id
"
$_domain_id
"
_debug _domain_id
"
$_domain_id
"
...
@@ -54,7 +54,7 @@ dns_aws_add() {
...
@@ -54,7 +54,7 @@ dns_aws_add() {
_info
"Getting existing records for
$fulldomain
"
_info
"Getting existing records for
$fulldomain
"
if
!
aws_rest GET
"2013-04-01
$_domain_id
/rrset"
"name=
$fulldomain
&type=TXT"
;
then
if
!
aws_rest GET
"2013-04-01
$_domain_id
/rrset"
"name=
$fulldomain
&type=TXT"
;
then
sleep
1
_
sleep 1
return
1
return
1
fi
fi
...
@@ -67,7 +67,7 @@ dns_aws_add() {
...
@@ -67,7 +67,7 @@ dns_aws_add() {
if
[
"
$_resource_record
"
]
&&
_contains
"
$response
"
"
$txtvalue
"
;
then
if
[
"
$_resource_record
"
]
&&
_contains
"
$response
"
"
$txtvalue
"
;
then
_info
"The TXT record already exists. Skipping."
_info
"The TXT record already exists. Skipping."
sleep
1
_
sleep 1
return
0
return
0
fi
fi
...
@@ -77,10 +77,10 @@ dns_aws_add() {
...
@@ -77,10 +77,10 @@ dns_aws_add() {
if
aws_rest POST
"2013-04-01
$_domain_id
/rrset/"
""
"
$_aws_tmpl_xml
"
&&
_contains
"
$response
"
"ChangeResourceRecordSetsResponse"
;
then
if
aws_rest POST
"2013-04-01
$_domain_id
/rrset/"
""
"
$_aws_tmpl_xml
"
&&
_contains
"
$response
"
"ChangeResourceRecordSetsResponse"
;
then
_info
"TXT record updated successfully."
_info
"TXT record updated successfully."
sleep
1
_
sleep 1
return
0
return
0
fi
fi
sleep
1
_
sleep 1
return
1
return
1
}
}
...
@@ -99,7 +99,7 @@ dns_aws_rm() {
...
@@ -99,7 +99,7 @@ dns_aws_rm() {
_debug
"First detect the root zone"
_debug
"First detect the root zone"
if
!
_get_root
"
$fulldomain
"
;
then
if
!
_get_root
"
$fulldomain
"
;
then
_err
"invalid domain"
_err
"invalid domain"
sleep
1
_
sleep 1
return
1
return
1
fi
fi
_debug _domain_id
"
$_domain_id
"
_debug _domain_id
"
$_domain_id
"
...
@@ -108,7 +108,7 @@ dns_aws_rm() {
...
@@ -108,7 +108,7 @@ dns_aws_rm() {
_info
"Getting existing records for
$fulldomain
"
_info
"Getting existing records for
$fulldomain
"
if
!
aws_rest GET
"2013-04-01
$_domain_id
/rrset"
"name=
$fulldomain
&type=TXT"
;
then
if
!
aws_rest GET
"2013-04-01
$_domain_id
/rrset"
"name=
$fulldomain
&type=TXT"
;
then
sleep
1
_
sleep 1
return
1
return
1
fi
fi
...
@@ -117,7 +117,7 @@ dns_aws_rm() {
...
@@ -117,7 +117,7 @@ dns_aws_rm() {
_debug
"_resource_record"
"
$_resource_record
"
_debug
"_resource_record"
"
$_resource_record
"
else
else
_debug
"no records exist, skip"
_debug
"no records exist, skip"
sleep
1
_
sleep 1
return
0
return
0
fi
fi
...
@@ -125,10 +125,10 @@ dns_aws_rm() {
...
@@ -125,10 +125,10 @@ dns_aws_rm() {
if
aws_rest POST
"2013-04-01
$_domain_id
/rrset/"
""
"
$_aws_tmpl_xml
"
&&
_contains
"
$response
"
"ChangeResourceRecordSetsResponse"
;
then
if
aws_rest POST
"2013-04-01
$_domain_id
/rrset/"
""
"
$_aws_tmpl_xml
"
&&
_contains
"
$response
"
"ChangeResourceRecordSetsResponse"
;
then
_info
"TXT record deleted successfully."
_info
"TXT record deleted successfully."
sleep
1
_
sleep 1
return
0
return
0
fi
fi
sleep
1
_
sleep 1
return
1
return
1
}
}
...
...
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