Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
letsencrypt.sh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
letsencrypt.sh
Commits
1233dc95
Commit
1233dc95
authored
Feb 15, 2016
by
Lukas Schauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exit with error message if curl has problems connecting (fixes #133)
parent
5ef4d86b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
letsencrypt.sh
letsencrypt.sh
+10
-0
No files found.
letsencrypt.sh
View file @
1233dc95
...
@@ -238,15 +238,25 @@ _openssl() {
...
@@ -238,15 +238,25 @@ _openssl() {
http_request
()
{
http_request
()
{
tempcont
=
"
$(
mktemp
-t
XXXXXX
)
"
tempcont
=
"
$(
mktemp
-t
XXXXXX
)
"
set
+e
if
[[
"
${
1
}
"
=
"head"
]]
;
then
if
[[
"
${
1
}
"
=
"head"
]]
;
then
statuscode
=
"
$(
curl
-s
-w
"%{http_code}"
-o
"
${
tempcont
}
"
"
${
2
}
"
-I
)
"
statuscode
=
"
$(
curl
-s
-w
"%{http_code}"
-o
"
${
tempcont
}
"
"
${
2
}
"
-I
)
"
curlret
=
"
${
?
}
"
elif
[[
"
${
1
}
"
=
"get"
]]
;
then
elif
[[
"
${
1
}
"
=
"get"
]]
;
then
statuscode
=
"
$(
curl
-s
-w
"%{http_code}"
-o
"
${
tempcont
}
"
"
${
2
}
"
)
"
statuscode
=
"
$(
curl
-s
-w
"%{http_code}"
-o
"
${
tempcont
}
"
"
${
2
}
"
)
"
curlret
=
"
${
?
}
"
elif
[[
"
${
1
}
"
=
"post"
]]
;
then
elif
[[
"
${
1
}
"
=
"post"
]]
;
then
statuscode
=
"
$(
curl
-s
-w
"%{http_code}"
-o
"
${
tempcont
}
"
"
${
2
}
"
-d
"
${
3
}
"
)
"
statuscode
=
"
$(
curl
-s
-w
"%{http_code}"
-o
"
${
tempcont
}
"
"
${
2
}
"
-d
"
${
3
}
"
)
"
curlret
=
"
${
?
}
"
else
else
set
-e
_exiterr
"Unknown request method:
${
1
}
"
_exiterr
"Unknown request method:
${
1
}
"
fi
fi
set
-e
if
[[
!
"
${
curlret
}
"
=
"0"
]]
;
then
_exiterr
"Problem connecting to server (curl returned with
${
curlret
}
)"
fi
if
[[
!
"
${
statuscode
:0:1
}
"
=
"2"
]]
;
then
if
[[
!
"
${
statuscode
:0:1
}
"
=
"2"
]]
;
then
echo
" + ERROR: An error occurred while sending
${
1
}
-request to
${
2
}
(Status
${
statuscode
}
)"
>
&2
echo
" + ERROR: An error occurred while sending
${
1
}
-request to
${
2
}
(Status
${
statuscode
}
)"
>
&2
...
...
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