aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2010-11-05 18:46:09 +0000
committerMichael Scherer <misc@mageia.org>2010-11-05 18:46:09 +0000
commit8974a274b1169798dced09725fc98fb46d36a87a (patch)
treed629fcbb7d4531388001d49dd39386e2742186da
parentaf9351740773d909ec8f716f97dcb3372171ed4d (diff)
downloadpuppet-8974a274b1169798dced09725fc98fb46d36a87a.tar
puppet-8974a274b1169798dced09725fc98fb46d36a87a.tar.gz
puppet-8974a274b1169798dced09725fc98fb46d36a87a.tar.bz2
puppet-8974a274b1169798dced09725fc98fb46d36a87a.tar.xz
puppet-8974a274b1169798dced09725fc98fb46d36a87a.zip
- use mv -f instead of cp + rm ( shorter, cleaner )
- move file creation later rather than creating it and removing it after
-rwxr-xr-xmodules/blog/templates/check_new-blog-post.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/blog/templates/check_new-blog-post.sh b/modules/blog/templates/check_new-blog-post.sh
index 10081508..ea4d9904 100755
--- a/modules/blog/templates/check_new-blog-post.sh
+++ b/modules/blog/templates/check_new-blog-post.sh
@@ -3,16 +3,16 @@
# Initialization
PATH_TO_FILE="/var/lib/blog"
/usr/bin/wget -qO $PATH_TO_FILE"/RSS_new" http://blog.mageia.org/?feed=rss2
-/bin/date +"%d:%m:%Y %H:%M" > $PATH_TO_FILE"/last_check"
# Check if RSS_old exists
if [ ! -f $PATH_TO_FILE"/RSS_old" ]
then
- /bin/cp $PATH_TO_FILE"/RSS_new" $PATH_TO_FILE"/RSS_old"
- /bin/rm -rf $PATH_TO_FILE"/RSS_new" $PATH_TO_FILE"/last_check"
+ /bin/mv -f $PATH_TO_FILE"/RSS_new" $PATH_TO_FILE"/RSS_old"
exit 1
fi
+/bin/date +"%d:%m:%Y %H:%M" > $PATH_TO_FILE"/last_check"
+
# Check if a new blog post on EN needs to be translated on other blogs
tmp_new=$(/bin/grep 'lastBuildDate' $PATH_TO_FILE"/RSS_new")
tmp_old=$(/bin/grep 'lastBuildDate' $PATH_TO_FILE"/RSS_old")
@@ -28,5 +28,4 @@ if [ "$tmp_old" = "$tmp_new" ]
fi
# Clean tmp files and copy RSS_new to RSS_old
-/bin/cp $PATH_TO_FILE"/RSS_new" $PATH_TO_FILE"/RSS_old"
-/bin/rm -rf $PATH_TO_FILE"/RSS_new"
+/bin/mv -f $PATH_TO_FILE"/RSS_new" $PATH_TO_FILE"/RSS_old"