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
1a5279bd
Unverified
Commit
1a5279bd
authored
May 31, 2019
by
der-berni
Committed by
GitHub
May 31, 2019
Browse files
cleanup according to styleguide
parent
534ddf01
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_one.sh
View file @
1a5279bd
...
@@ -110,19 +110,19 @@ dns_one_rm() {
...
@@ -110,19 +110,19 @@ dns_one_rm() {
# _sub_domain=_acme-challenge.www
# _sub_domain=_acme-challenge.www
# _domain=domain.com
# _domain=domain.com
_get_root
()
{
_get_root
()
{
domain
=
$1
domain
=
"
$1
"
i
=
2
i
=
2
p
=
1
p
=
1
while
true
;
do
while
true
;
do
h
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
$i
-100
)
h
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
$i
-100
)
if
[
-z
"
$h
"
]
;
then
if
[
-z
"
$h
"
]
;
then
#not valid
#not valid
return
1
return
1
fi
fi
response
=
"
$(
_get
"https://www.one.com/admin/api/domains/
$h
/dns/custom_records"
)
"
response
=
"
$(
_get
"https://www.one.com/admin/api/domains/
$h
/dns/custom_records"
)
"
if
!
_contains
"
$response
"
"CRMRST_000302"
;
then
if
!
_contains
"
$response
"
"CRMRST_000302"
;
then
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_domain
=
"
$h
"
_domain
=
"
$h
"
...
@@ -160,20 +160,20 @@ _dns_one_login() {
...
@@ -160,20 +160,20 @@ _dns_one_login() {
postdata
=
"
$postdata
&password1=
$ONECOM_Password
"
postdata
=
"
$postdata
&password1=
$ONECOM_Password
"
postdata
=
"
$postdata
&loginTarget="
postdata
=
"
$postdata
&loginTarget="
#_debug postdata "$postdata"
#_debug postdata "$postdata"
response
=
"
$(
_post
"
$postdata
"
"https://www.one.com/admin/login.do"
""
"POST"
"application/x-www-form-urlencoded"
)
"
response
=
"
$(
_post
"
$postdata
"
"https://www.one.com/admin/login.do"
""
"POST"
"application/x-www-form-urlencoded"
)
"
#_debug response "$response"
#_debug response "$response"
# Get SessionID
# Get SessionID
JSESSIONID
=
"
$(
grep
"OneSIDCrmAdmin"
"
$HTTP_HEADER
"
|
grep
"^[Ss]et-[Cc]ookie:"
| _head_n 1 | _egrep_o
'OneSIDCrmAdmin=[^;]*;'
|
tr
-d
';'
)
"
JSESSIONID
=
"
$(
grep
"OneSIDCrmAdmin"
"
$HTTP_HEADER
"
|
grep
"^[Ss]et-[Cc]ookie:"
| _head_n 1 | _egrep_o
'OneSIDCrmAdmin=[^;]*;'
|
tr
-d
';'
)
"
_debug jsessionid
"
$JSESSIONID
"
_debug jsessionid
"
$JSESSIONID
"
if
[
-z
"
$JSESSIONID
"
]
;
then
if
[
-z
"
$JSESSIONID
"
]
;
then
_err
"error sessionid cookie not found"
_err
"error sessionid cookie not found"
return
1
return
1
fi
fi
export
_H1
=
"Cookie:
${
JSESSIONID
}
"
export
_H1
=
"Cookie:
${
JSESSIONID
}
"
return
0
return
0
}
}
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