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
c2c8f320
Commit
c2c8f320
authored
Oct 03, 2016
by
neil
Browse files
fix for wget
parent
9f43c270
Changes
1
Show whitespace changes
Inline
Side-by-side
acme.sh
View file @
c2c8f320
...
...
@@ -1027,6 +1027,13 @@ _get() {
return $ret
}
_head_n() {
head -n $1
}
_tail_n() {
tail -n $1
}
# url payload needbase64 keyfile
_send_signed_request() {
...
...
@@ -1057,7 +1064,7 @@ _send_signed_request() {
_debug3 _headers "$_headers"
nonce
=
"
$(
echo
"
$_headers
"
|
grep
"Replay-Nonce:"
|
head
-
n
1 |
tr
-d
"
\r\n
"
|
cut
-d
':'
-f
2
)
"
nonce="$( echo "$_headers" | grep "Replay-Nonce:" |
_
head
_
n 1 | tr -d "\r\n " | cut -d ':' -f 2)"
_debug3 nonce "$nonce"
...
...
@@ -1087,7 +1094,7 @@ _send_signed_request() {
_debug2 responseHeaders "$responseHeaders"
_debug2 response "$response"
code
=
"
$(
grep
"^HTTP"
$HTTP_HEADER
|
tail
-
1
|
cut
-d
" "
-f
2 |
tr
-d
"
\r\n
"
)
"
code="$(grep "^HTTP" $HTTP_HEADER |
_
tail
_n
1 | cut -d " " -f 2 | tr -d "\r\n" )"
_debug code $code
}
...
...
@@ -1938,10 +1945,10 @@ _regAccount() {
return 1
fi
_accUri
=
"
$(
echo
"
$responseHeaders
"
|
grep
"^Location:"
|
cut
-d
' '
-f
2|
tr
-d
"
\r\n
"
)
"
_accUri="$(echo "$responseHeaders" | grep "^Location:" |
_head_n 1 |
cut -d ' ' -f 2| tr -d "\r\n")"
_debug "_accUri" "$_accUri"
_tos
=
"
$(
echo
"
$responseHeaders
"
|
grep
"^Link:.*rel=
\"
terms-of-service
\"
"
| _egrep_o
"<.*>"
|
tr
-d
'<>'
)
"
_tos="$(echo "$responseHeaders" | grep "^Link:.*rel=\"terms-of-service\"" |
_head_n 1 |
_egrep_o "<.*>" | tr -d '<>')"
_debug "_tos" "$_tos"
if [ -z "$_tos" ] ; then
_debug "Use default tos: $DEFAULT_AGREEMENT"
...
...
@@ -2462,7 +2469,7 @@ issue() {
fi
_rcert="$response"
Le_LinkCert
=
"
$(
grep
-i
'^Location.*$'
$HTTP_HEADER
|
head
-
n
1 |
tr
-d
"
\r\n
"
|
cut
-d
" "
-f
2
)
"
Le_LinkCert="$(grep -i '^Location.*$' $HTTP_HEADER |
_
head
_
n 1 | tr -d "\r\n" | cut -d " " -f 2)"
_savedomainconf "Le_LinkCert" "$Le_LinkCert"
if [ "$Le_LinkCert" ] ; then
...
...
@@ -2501,7 +2508,7 @@ issue() {
_cleardomainconf "Le_Vlist"
Le_LinkIssuer
=
$(
grep
-i
'^Link'
$HTTP_HEADER
|
head
-
n
1 |
cut
-d
" "
-f
2|
cut
-d
';'
-f
1 |
tr
-d
'<>'
)
Le_LinkIssuer=$(grep -i '^Link' $HTTP_HEADER |
_
head
_
n 1 | cut -d " " -f 2| cut -d ';' -f 1 | tr -d '<>' )
if ! _contains "$Le_LinkIssuer" ":" ; then
Le_LinkIssuer="$API$Le_LinkIssuer"
fi
...
...
@@ -2994,7 +3001,7 @@ _deactivate() {
return 1
fi
authzUri
=
"
$(
echo
"
$responseHeaders
"
|
grep
"^Location:"
|
cut
-d
' '
-f
2 |
tr
-d
"
\r\n
"
)
"
authzUri="$(echo "$responseHeaders" | grep "^Location:" |
_head_n 1 |
cut -d ' ' -f 2 | tr -d "\r\n")"
_debug "authzUri" "$authzUri"
if [ ! -z "$code" ] && [ ! "$code" = '201' ] ; then
...
...
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