Commit 1ceb401f authored by Leo Iannacone's avatar Leo Iannacone

Update a smarter cronjob

parent 5860e22b
......@@ -5,4 +5,28 @@ DIR_WWW="${DIR_BASE}/www/"
DIR_BZR_BASE="${DIR_BASE}/bzr/"
DIR_BZR_WWW="${DIR_BZR_BASE}/www/"
cp -Rpx ${DIR_BZR_WWW} ${DIR_WWW}
function update_files() {
cp -Rpx ${DIR_BZR_WWW} ${DIR_WWW}
}
############################################
## Test if repo has been updated ##
############################################
TMP_FILE=/tmp/helprepo_version ## Temp file where version bzr repo has been saved
## Create temp file if it doesn't exist
if ! test -f $TMP_FILE ; then
cat /dev/null > $TMP_FILE
fi
cd $DIR_BZR_BASE
VERSION=`cat $TMP_FILE`
VERSION_TEST=`bzr up 2>&1 | tail -n1 `
if [ ! "$VERSION_TEST" = "$VERSION" ] ; then
echo "$VERSION_TEST" > $TMP_FILE
update_files
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment