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
0ed4c939
Commit
0ed4c939
authored
Jan 30, 2016
by
neil
Browse files
sleep to wait dns record to take effect.
parent
638b9a05
Changes
2
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns-cf.sh
View file @
0ed4c939
...
@@ -37,7 +37,8 @@ dns-cf-add() {
...
@@ -37,7 +37,8 @@ dns-cf-add() {
if
_cf_rest POST
"/zones/
$_domain_id
/dns_records"
"{
\"
type
\"
:
\"
TXT
\"
,
\"
name
\"
:
\"
$fulldomain
\"
,
\"
content
\"
:
\"
$txtvalue
\"
,
\"
ttl
\"
:120}"
;
then
if
_cf_rest POST
"/zones/
$_domain_id
/dns_records"
"{
\"
type
\"
:
\"
TXT
\"
,
\"
name
\"
:
\"
$fulldomain
\"
,
\"
content
\"
:
\"
$txtvalue
\"
,
\"
ttl
\"
:120}"
;
then
if
printf
$response
|
grep
$fulldomain
>
/dev/null
;
then
if
printf
$response
|
grep
$fulldomain
>
/dev/null
;
then
_info
"Added, sleeping 10 seconds"
_info
"Added, sleeping 10 seconds"
sleep
1
sleep
10
#todo: check if the record takes effect
return
0
return
0
else
else
_err
"Add txt record error."
_err
"Add txt record error."
...
@@ -54,6 +55,7 @@ dns-cf-add() {
...
@@ -54,6 +55,7 @@ dns-cf-add() {
if
[
"
$?
"
==
"0"
]
;
then
if
[
"
$?
"
==
"0"
]
;
then
_info
"Updated, sleeping 10 seconds"
_info
"Updated, sleeping 10 seconds"
sleep
10
sleep
10
#todo: check if the record takes effect
return
0
;
return
0
;
fi
fi
_err
"Update error"
_err
"Update error"
...
...
le.sh
View file @
0ed4c939
...
@@ -673,6 +673,10 @@ issue() {
...
@@ -673,6 +673,10 @@ issue() {
fi
fi
if
[
"
$dnsadded
"
==
'1'
]
;
then
_info
"Sleep 60 seconds for the txt records to take effect"
sleep
60
fi
_debug
"ok, let's start to verify"
_debug
"ok, let's start to verify"
ventries
=
$(
echo
"
$vlist
"
|
sed
"s/,/ /g"
)
ventries
=
$(
echo
"
$vlist
"
|
sed
"s/,/ /g"
)
...
...
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