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
6a0ed51f
Unverified
Commit
6a0ed51f
authored
Jul 24, 2020
by
Adrian Fedoreanu
Browse files
replace response equals with contains
parent
bb7c11ad
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_1984hosting.sh
View file @
6a0ed51f
...
...
@@ -3,7 +3,7 @@
#So, here must be a method dns_1984hosting_add()
#Which will be called by acme.sh to add the txt record to your api system.
#returns 0 means success, otherwise error.
#
#Author: Adrian Fedoreanu
#Report Bugs here: https://github.com/acmesh-official/acme.sh
# or here... https://github.com/acmesh-official/acme.sh/issues/2851
...
...
@@ -100,7 +100,7 @@ _1984hosting_add_txt_record() {
elif
_contains
"
$response
"
"<html>"
;
then
_err
"1984Hosting failed to add TXT record for
$subdomain
. Check
$HTTP_HEADER
file"
return
1
elif
[
"
$response
"
=
'
{
"auth": false
, "ok": false}'
]
;
then
elif
_contains
"
$response
"
'"auth": false
'
;
then
_err
"1984Hosting failed to add TXT record for
$subdomain
. Invalid or expired cookie"
return
1
fi
...
...
@@ -167,7 +167,7 @@ _1984hosting_login() {
response
=
"
$(
echo
"
$response
"
| _normalizeJson
)
"
_debug2 response
"
$response
"
if
[
"
$response
"
=
'{
"loggedin": true
, "ok": true}'
]
;
then
if
_contains
"
$response
"
'
"loggedin": true
'
;
then
One984HOSTING_COOKIE
=
"
$(
grep
-i
'^set-cookie:'
"
$HTTP_HEADER
"
| _tail_n 1 | _egrep_o
'sessionid=[^;]*;'
|
tr
-d
';'
)
"
export
One984HOSTING_COOKIE
_saveaccountconf_mutable One984HOSTING_COOKIE
"
$One984HOSTING_COOKIE
"
...
...
@@ -196,7 +196,7 @@ _check_cookie() {
_authget
"https://management.1984hosting.com/accounts/loginstatus/"
response
=
"
$(
echo
"
$_response
"
| _normalizeJson
)
"
if
[
"
$
_
response
"
=
'
{
"ok": true
}'
]
;
then
if
_contains
"
$response
"
'"ok": true
'
;
then
_debug
"Cached cookie still valid"
return
0
fi
...
...
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