diff options
author | Michael Scherer <misc@mageia.org> | 2010-11-20 08:47:07 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2010-11-20 08:47:07 +0000 |
commit | 5c7a0f8bb6a5c4baf2644bd7cd965c92c5d7d7ae (patch) | |
tree | 1ba6ce469feafe1fe833a45229b8de804d65c012 | |
parent | 95a3a6b598e3edaf052b7fdb2ee33d0e3424a0b4 (diff) | |
download | puppet-5c7a0f8bb6a5c4baf2644bd7cd965c92c5d7d7ae.tar puppet-5c7a0f8bb6a5c4baf2644bd7cd965c92c5d7d7ae.tar.gz puppet-5c7a0f8bb6a5c4baf2644bd7cd965c92c5d7d7ae.tar.bz2 puppet-5c7a0f8bb6a5c4baf2644bd7cd965c92c5d7d7ae.tar.xz puppet-5c7a0f8bb6a5c4baf2644bd7cd965c92c5d7d7ae.zip |
- allows the PATH_TO_FILE value to be overidden for testing purpose
- check the return of wget and stop if the server do not answer, to prevent resending notification once server is restarted
-rwxr-xr-x | modules/blog/templates/check_new-blog-post.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/blog/templates/check_new-blog-post.sh b/modules/blog/templates/check_new-blog-post.sh index 288b4373..c3183375 100755 --- a/modules/blog/templates/check_new-blog-post.sh +++ b/modules/blog/templates/check_new-blog-post.sh @@ -1,9 +1,12 @@ #!/bin/sh # Initialization -PATH_TO_FILE="/var/lib/blog" +PATH_TO_FILE=${PATH_TO_FILE:-/var/lib/blog} /usr/bin/wget -qO $PATH_TO_FILE"/RSS_new" http://blog.mageia.org/?feed=rss2 - +if [ -n $? ] +then + exit 2 +fi # Check if RSS_old exists if [ ! -f $PATH_TO_FILE"/RSS_old" ] then |