From 5c7a0f8bb6a5c4baf2644bd7cd965c92c5d7d7ae Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sat, 20 Nov 2010 08:47:07 +0000 Subject: - 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 --- modules/blog/templates/check_new-blog-post.sh | 7 +++++-- 1 file 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 -- cgit v1.2.1