Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
slapos
Commits
82f22089
Commit
82f22089
authored
Oct 05, 2012
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update check_page_content recipe to use custom patrern
parent
deb551d4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
slapos/recipe/check_page_content/__init__.py
slapos/recipe/check_page_content/__init__.py
+4
-2
slapos/recipe/check_page_content/template/check_page_content.in
.../recipe/check_page_content/template/check_page_content.in
+2
-1
No files found.
slapos/recipe/check_page_content/__init__.py
View file @
82f22089
...
@@ -34,10 +34,12 @@ class Recipe(GenericBaseRecipe):
...
@@ -34,10 +34,12 @@ class Recipe(GenericBaseRecipe):
"""
"""
def
install
(
self
):
def
install
(
self
):
url
=
self
.
options
[
'url'
].
strip
()
config
=
{
config
=
{
'url'
:
self
.
options
[
'url'
]
,
'url'
:
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'
],
'pattern'
:
self
.
options
.
get
(
'pattern'
,
url
),
}
}
# XXX-Cedric in this script, curl won't check certificate
# XXX-Cedric in this script, curl won't check certificate
...
...
slapos/recipe/check_page_content/template/check_page_content.in
View file @
82f22089
...
@@ -3,13 +3,14 @@
...
@@ -3,13 +3,14 @@
# BEWARE: It will be overwritten automatically
# BEWARE: It will be overwritten automatically
URL="%(url)s"
URL="%(url)s"
PATTERN="%(pattern)s"
if [ -z $URL ]; then
if [ -z $URL ]; then
echo "No URL specified." >&2
echo "No URL specified." >&2
exit 3
exit 3
fi
fi
%(curl_path)s -k -sL $URL | grep "$
URL
" > /dev/null
%(curl_path)s -k -sL $URL | grep "$
PATTERN
" > /dev/null
if [ $? != 0 ]; then
if [ $? != 0 ]; then
echo "Content at $URL seems to be corrupted" >&2
echo "Content at $URL seems to be corrupted" >&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