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
c767f3d9
Commit
c767f3d9
authored
Dec 27, 2015
by
neil
Browse files
error debug info
parent
a2c5949d
Changes
1
Hide whitespace changes
Inline
Side-by-side
le.sh
View file @
c767f3d9
...
@@ -34,6 +34,14 @@ _info() {
...
@@ -34,6 +34,14 @@ _info() {
fi
fi
}
}
_err
()
{
if
[
-z
"
$2
"
]
;
then
echo
"
$1
"
>
&2
else
echo
"
$1
:
$2
"
>
&2
fi
}
#domain [2048]
#domain [2048]
createAccountKey
()
{
createAccountKey
()
{
if
[
-z
"
$1
"
]
;
then
if
[
-z
"
$1
"
]
;
then
...
@@ -304,7 +312,7 @@ issue() {
...
@@ -304,7 +312,7 @@ issue() {
elif
[
"
$code
"
==
'409'
]
;
then
elif
[
"
$code
"
==
'409'
]
;
then
_info
"Already registered"
_info
"Already registered"
else
else
_
info
"Register account Error."
_
err
"Register account Error."
return
1
return
1
fi
fi
...
@@ -319,7 +327,7 @@ issue() {
...
@@ -319,7 +327,7 @@ issue() {
_send_signed_request
"
$API
/acme/new-authz"
"{
\"
resource
\"
:
\"
new-authz
\"
,
\"
identifier
\"
: {
\"
type
\"
:
\"
dns
\"
,
\"
value
\"
:
\"
$d
\"
}}"
_send_signed_request
"
$API
/acme/new-authz"
"{
\"
resource
\"
:
\"
new-authz
\"
,
\"
identifier
\"
: {
\"
type
\"
:
\"
dns
\"
,
\"
value
\"
:
\"
$d
\"
}}"
if
[
!
-z
"
$code
"
]
&&
[
!
"
$code
"
==
'201'
]
;
then
if
[
!
-z
"
$code
"
]
&&
[
!
"
$code
"
==
'201'
]
;
then
_
info
"new-authz error:
$
d
"
_
err
"new-authz error:
$
response
"
return
1
return
1
fi
fi
...
@@ -349,7 +357,7 @@ issue() {
...
@@ -349,7 +357,7 @@ issue() {
_send_signed_request
$uri
"{
\"
resource
\"
:
\"
challenge
\"
,
\"
keyAuthorization
\"
:
\"
$keyauthorization
\"
}"
_send_signed_request
$uri
"{
\"
resource
\"
:
\"
challenge
\"
,
\"
keyAuthorization
\"
:
\"
$keyauthorization
\"
}"
if
[
!
-z
"
$code
"
]
&&
[
!
"
$code
"
==
'202'
]
;
then
if
[
!
-z
"
$code
"
]
&&
[
!
"
$code
"
==
'202'
]
;
then
_
info
"challenge error:
$d
"
_
err
"challenge error:
$d
"
return
1
return
1
fi
fi
...
@@ -359,7 +367,7 @@ issue() {
...
@@ -359,7 +367,7 @@ issue() {
_debug
"checking"
_debug
"checking"
if
!
_get
$uri
;
then
if
!
_get
$uri
;
then
_
info
"Verify error:
$
d
"
_
err
"Verify error:
$
resource
"
return
1
return
1
fi
fi
...
@@ -371,15 +379,14 @@ issue() {
...
@@ -371,15 +379,14 @@ issue() {
if
[
"
$status
"
==
"invalid"
]
;
then
if
[
"
$status
"
==
"invalid"
]
;
then
error
=
$(
echo
$response
| egrep
-o
'"error":{[^}]*}'
|
grep
-o
'"detail":"[^"]*"'
|
cut
-d
'"'
-f
4
)
error
=
$(
echo
$response
| egrep
-o
'"error":{[^}]*}'
|
grep
-o
'"detail":"[^"]*"'
|
cut
-d
'"'
-f
4
)
_info
"Verify error:
$d
"
_err
"Verify error:
$error
"
_debug
$error
return
1
;
return
1
;
fi
fi
if
[
"
$status
"
==
"pending"
]
;
then
if
[
"
$status
"
==
"pending"
]
;
then
_info
"Verify pending:
$d
"
_info
"Verify pending:
$d
"
else
else
_
info
"Verify error:
$
d
"
_
err
"Verify error:
$
response
"
return
1
return
1
fi
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