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
ea18c470
Commit
ea18c470
authored
Sep 12, 2021
by
Christophe B Billheimer
Browse files
move getting zone id code into its own function
parent
ced7110a
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_1984hosting.sh
View file @
ea18c470
...
@@ -95,16 +95,6 @@ dns_1984hosting_rm() {
...
@@ -95,16 +95,6 @@ dns_1984hosting_rm() {
_debug _domain
"
$_domain
"
_debug _domain
"
$_domain
"
_debug
"Delete
$fulldomain
TXT record"
_debug
"Delete
$fulldomain
TXT record"
url
=
"https://management.1984hosting.com/domains"
_htmlget
"
$url
"
"
$_domain
"
_debug2 _response
"
$_response
"
zone_id
=
"
$(
echo
"
$_response
"
| _egrep_o
'zone\/[0-9]+'
)
"
_debug2 zone_id
"
$zone_id
"
if
[
-z
"
$zone_id
"
]
;
then
_err
"Error getting zone_id for
$1
"
return
1
fi
_htmlget
"
$url
/
$zone_id
"
"
$_sub_domain
"
_htmlget
"
$url
/
$zone_id
"
"
$_sub_domain
"
_debug2 _response
"
$_response
"
_debug2 _response
"
$_response
"
...
@@ -221,6 +211,22 @@ _get_root() {
...
@@ -221,6 +211,22 @@ _get_root() {
return
1
return
1
}
}
#domain.com
#returns zone id for domain.com
_get_zone_id
()
{
url
=
"https://management.1984hosting.com/domains"
_htmlget
"
$url
"
"
$_domain
"
_debug2 _response
"
$_response
"
_zone_id
=
"
$(
echo
"
$_response
"
| _egrep_o
'zone\/[0-9]+'
)
"
_debug2 _zone_id
"
$_zone_id
"
if
[
-z
"
$zone_id
"
]
;
then
_err
"Error getting _zone_id for
$1
"
return
1
fi
return
0
}
# add extra headers to request
# add extra headers to request
_authget
()
{
_authget
()
{
export
_H1
=
"Cookie:
$One984HOSTING_SESSIONID_COOKIE
"
export
_H1
=
"Cookie:
$One984HOSTING_SESSIONID_COOKIE
"
...
...
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