Commit e51a13f4 authored by Giuseppe Terrasi's avatar Giuseppe Terrasi

parent ee52a71d
#!/bin/bash
WEB=/srv/chiedi.ubuntu-it.org WEB=/srv/chiedi.ubuntu-it.org
WWW=$WEB/www/osqa/ WWW=$WEB/www/osqa/
BZR=/srv/shared-branches/ubuntu-it-ask BZR=/srv/shared-branches
BZRWWW=$BZR/ubuntu-it-ask/ BZRWWW=$BZR/ubuntu-it-ask/
TMP_FILE=/tmp/askrepo_version
function update_files {
##Copy of all files
cp -ax $BZRWWW/* $WWW/ cp -ax $BZRWWW/* $WWW/
}
############################################
## Test if repo has been updated ##
############################################
TMP_FILE=/tmp/wwwrepo_version ## Temp file where version bzr repo was saved
## Create temp file if it doesn't exist
if ! test -f $TMP_FILE ; then if ! test -f $TMP_FILE ; then
cat /dev/null > $TMP_FILE cat /dev/null > $TMP_FILE
fi fi
cd $BZR cd $BZRWWW
VERSION=`cat $TMP_FILE` VERSION=`cat $TMP_FILE`
VERSION_TEST=`bzr up 2>&1 | tail -n1 ` VERSION_TEST=`bzr up 2>&1 | tail -n1 `
if [ ! "$VERSION_TEST" = "$VERSION" ] ; then if [ ! "$VERSION_TEST" = "$VERSION" ] ; then
echo "$VERSION_TEST" > $TMP_FILE echo "$VERSION_TEST" > $TMP_FILE
update_files
fi 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