[Mageia-sysadm] [338] - allows the PATH_TO_FILE value to be overidden for testing purpose

root at mageia.org root at mageia.org
Sat Nov 20 09:47:07 CET 2010


Revision: 338
Author:   misc
Date:     2010-11-20 09:47:07 +0100 (Sat, 20 Nov 2010)
Log Message:
-----------
- 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 

Modified Paths:
--------------
    puppet/modules/blog/templates/check_new-blog-post.sh

Modified: puppet/modules/blog/templates/check_new-blog-post.sh
===================================================================
--- puppet/modules/blog/templates/check_new-blog-post.sh	2010-11-20 08:38:06 UTC (rev 337)
+++ puppet/modules/blog/templates/check_new-blog-post.sh	2010-11-20 08:47:07 UTC (rev 338)
@@ -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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20101120/5f6aeda6/attachment.html>


More information about the Mageia-sysadm mailing list