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
5df2ca3e
Commit
5df2ca3e
authored
Mar 14, 2017
by
boyanpeychev
Browse files
Add DNS API for ClouDNS
parent
a15f87ae
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_cloudns.sh
View file @
5df2ca3e
...
@@ -14,7 +14,7 @@ dns_cloudns_add() {
...
@@ -14,7 +14,7 @@ dns_cloudns_add() {
return
1
return
1
fi
fi
zone
=
"
$(
_dns_cloudns_get_zone_name
$1
)
"
zone
=
"
$(
_dns_cloudns_get_zone_name
"
$1
"
)
"
if
[
-z
"
$zone
"
]
;
then
if
[
-z
"
$zone
"
]
;
then
_err
"Missing DNS zone at ClouDNS. Please log into your control panel and create the required DNS zone for the initial setup."
_err
"Missing DNS zone at ClouDNS. Please log into your control panel and create the required DNS zone for the initial setup."
return
1
return
1
...
@@ -29,7 +29,6 @@ dns_cloudns_add() {
...
@@ -29,7 +29,6 @@ dns_cloudns_add() {
_debug record
"
$record
"
_debug record
"
$record
"
_debug record_id
"
$record_id
"
_debug record_id
"
$record_id
"
if
[
-z
"
$record_id
"
]
;
then
if
[
-z
"
$record_id
"
]
;
then
_info
"Adding the TXT record for
$1
"
_info
"Adding the TXT record for
$1
"
_dns_cloudns_http_api_call
"dns/add-record.json"
"domain-name=
$zone
&record-type=TXT&host=
$host
&record=
$record
&ttl=60"
_dns_cloudns_http_api_call
"dns/add-record.json"
"domain-name=
$zone
&record-type=TXT&host=
$host
&record=
$record
&ttl=60"
...
@@ -60,7 +59,7 @@ dns_cloudns_rm() {
...
@@ -60,7 +59,7 @@ dns_cloudns_rm() {
fi
fi
if
[
-z
"
$zone
"
]
;
then
if
[
-z
"
$zone
"
]
;
then
zone
=
"
$(
_dns_cloudns_get_zone_name
$1
)
"
zone
=
"
$(
_dns_cloudns_get_zone_name
"
$1
"
)
"
if
[
-z
"
$zone
"
]
;
then
if
[
-z
"
$zone
"
]
;
then
_err
"Missing DNS zone at ClouDNS. Please log into your control panel and create the required DNS zone for the initial setup."
_err
"Missing DNS zone at ClouDNS. Please log into your control panel and create the required DNS zone for the initial setup."
return
1
return
1
...
@@ -118,7 +117,7 @@ _dns_cloudns_get_zone_name() {
...
@@ -118,7 +117,7 @@ _dns_cloudns_get_zone_name() {
return
1
return
1
fi
fi
_debug zoneForCheck
$zoneForCheck
_debug zoneForCheck
"
$zoneForCheck
"
_dns_cloudns_http_api_call
"dns/get-zone-info.json"
"domain-name=
$zoneForCheck
"
_dns_cloudns_http_api_call
"dns/get-zone-info.json"
"domain-name=
$zoneForCheck
"
...
@@ -127,7 +126,7 @@ _dns_cloudns_get_zone_name() {
...
@@ -127,7 +126,7 @@ _dns_cloudns_get_zone_name() {
return
0
return
0
fi
fi
i
=
$(
expr
"
$i
"
+
1
)
i
=
$(
(
$i
+
1
)
)
done
done
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