Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos-caddy
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
Guillaume Hervier
slapos-caddy
Commits
6cbce4d8
Commit
6cbce4d8
authored
Aug 06, 2013
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check-url: Add check-secure parameter to return success in case of code 401
parent
dadcae27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
slapos/recipe/check_url_available/__init__.py
slapos/recipe/check_url_available/__init__.py
+1
-0
slapos/recipe/check_url_available/template/check_url.in
slapos/recipe/check_url_available/template/check_url.in
+7
-0
No files found.
slapos/recipe/check_url_available/__init__.py
View file @
6cbce4d8
...
@@ -37,6 +37,7 @@ class Recipe(GenericBaseRecipe):
...
@@ -37,6 +37,7 @@ class Recipe(GenericBaseRecipe):
'url'
:
self
.
options
[
'url'
],
'url'
:
self
.
options
[
'url'
],
'shell_path'
:
self
.
options
[
'dash_path'
],
'shell_path'
:
self
.
options
[
'dash_path'
],
'curl_path'
:
self
.
options
[
'curl_path'
],
'curl_path'
:
self
.
options
[
'curl_path'
],
'check_secure'
:
self
.
options
.
get
(
'check-secure'
,
0
)
}
}
# XXX-Cedric in this script, curl won't check certificate
# XXX-Cedric in this script, curl won't check certificate
...
...
slapos/recipe/check_url_available/template/check_url.in
View file @
6cbce4d8
...
@@ -31,6 +31,13 @@ if [ $CODE -eq 000 ]; then
...
@@ -31,6 +31,13 @@ if [ $CODE -eq 000 ]; then
exit 1
exit 1
fi
fi
if [ %(check_secure)s -eq 1 ]; then
if [ $CODE -eq 401 ]; then
echo "$URL is protected (returned $CODE)." >&2
exit 0
fi
fi
if ! [ $CODE -eq 200 ]; then
if ! [ $CODE -eq 200 ]; then
echo "$URL is not available (returned $CODE)." >&2
echo "$URL is not available (returned $CODE)." >&2
exit 2
exit 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