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
472ed721
Unverified
Commit
472ed721
authored
Feb 20, 2019
by
diseq
Committed by
GitHub
Feb 20, 2019
Browse files
fix format
parent
ed3f2646
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_one.sh
View file @
472ed721
...
@@ -33,7 +33,6 @@ dns_one_add() {
...
@@ -33,7 +33,6 @@ dns_one_add() {
_saveaccountconf_mutable ONECOM_USER
"
$ONECOM_USER
"
_saveaccountconf_mutable ONECOM_USER
"
$ONECOM_USER
"
_saveaccountconf_mutable ONECOM_PASSWORD
"
$ONECOM_PASSWORD
"
_saveaccountconf_mutable ONECOM_PASSWORD
"
$ONECOM_PASSWORD
"
# Login with user and password
# Login with user and password
postdata
=
"loginDomain=true"
postdata
=
"loginDomain=true"
postdata
=
"
$postdata
&displayUsername=
$ONECOM_USER
"
postdata
=
"
$postdata
&displayUsername=
$ONECOM_USER
"
...
@@ -51,16 +50,13 @@ dns_one_add() {
...
@@ -51,16 +50,13 @@ dns_one_add() {
export
_H1
=
"Cookie:
${
JSESSIONID
}
"
export
_H1
=
"Cookie:
${
JSESSIONID
}
"
# get entries
# get entries
response
=
"
$(
_get
"https://www.one.com/admin/api/domains/
$mydomain
/dns/custom_records"
)
"
response
=
"
$(
_get
"https://www.one.com/admin/api/domains/
$mydomain
/dns/custom_records"
)
"
_debug response
"
$response
"
_debug response
"
$response
"
CSRF_G_TOKEN
=
"
$(
grep
"CSRF_G_TOKEN="
"
$HTTP_HEADER
"
|
grep
"^Set-Cookie:"
| _tail_n 1 | _egrep_o
'CSRF_G_TOKEN=[^;]*;'
|
tr
-d
';'
)
"
CSRF_G_TOKEN
=
"
$(
grep
"CSRF_G_TOKEN="
"
$HTTP_HEADER
"
|
grep
"^Set-Cookie:"
| _tail_n 1 | _egrep_o
'CSRF_G_TOKEN=[^;]*;'
|
tr
-d
';'
)
"
export
_H2
=
"Cookie:
${
CSRF_G_TOKEN
}
"
export
_H2
=
"Cookie:
${
CSRF_G_TOKEN
}
"
# Update the IP address for domain entry
# Update the IP address for domain entry
postdata
=
"{
\"
type
\"
:
\"
dns_custom_records
\"
,
\"
attributes
\"
:{
\"
priority
\"
:0,
\"
ttl
\"
:600,
\"
type
\"
:
\"
TXT
\"
,
\"
prefix
\"
:
\"
$mysubdomain
\"
,
\"
content
\"
:
\"
$txtvalue
\"
}}"
postdata
=
"{
\"
type
\"
:
\"
dns_custom_records
\"
,
\"
attributes
\"
:{
\"
priority
\"
:0,
\"
ttl
\"
:600,
\"
type
\"
:
\"
TXT
\"
,
\"
prefix
\"
:
\"
$mysubdomain
\"
,
\"
content
\"
:
\"
$txtvalue
\"
}}"
_debug postdata
"
$postdata
"
_debug postdata
"
$postdata
"
...
@@ -96,7 +92,6 @@ dns_one_rm() {
...
@@ -96,7 +92,6 @@ dns_one_rm() {
return
1
return
1
fi
fi
# Login with user and password
# Login with user and password
postdata
=
"loginDomain=true"
postdata
=
"loginDomain=true"
postdata
=
"
$postdata
&displayUsername=
$ONECOM_USER
"
postdata
=
"
$postdata
&displayUsername=
$ONECOM_USER
"
...
@@ -113,7 +108,6 @@ dns_one_rm() {
...
@@ -113,7 +108,6 @@ dns_one_rm() {
export
_H1
=
"Cookie:
${
JSESSIONID
}
"
export
_H1
=
"Cookie:
${
JSESSIONID
}
"
# get entries
# get entries
response
=
"
$(
_get
"https://www.one.com/admin/api/domains/
$mydomain
/dns/custom_records"
)
"
response
=
"
$(
_get
"https://www.one.com/admin/api/domains/
$mydomain
/dns/custom_records"
)
"
response
=
"
$(
echo
"
$response
"
| _normalizeJson
)
"
response
=
"
$(
echo
"
$response
"
| _normalizeJson
)
"
...
...
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