Merge lp:~milo/ubuntu-it-ask/cronjob-fix into lp:ubuntu-it-ask

Proposed by Milo Casagrande
Status: Merged
Merged at revision: 66
Proposed branch: lp:~milo/ubuntu-it-ask/cronjob-fix
Merge into: lp:ubuntu-it-ask
Diff against target: 46 lines (+17/-13)
1 file modified
cronjob (+17/-13)
To merge this branch: bzr merge lp:~milo/ubuntu-it-ask/cronjob-fix
Reviewer Review Type Date Requested Status
Ubuntu-it Ask Pending
Review via email: mp+155610@code.launchpad.net

Description of the change

Rielaborato il cronjob, aggiungta funzione per impostare permessi e
proprietario di file e directory.

Altre modifiche minori.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'cronjob'
--- cronjob 2013-03-24 11:28:54 +0000
+++ cronjob 2013-03-26 20:46:21 +0000
@@ -1,25 +1,29 @@
1#!/bin/bash1#!/bin/bash
2
2WEB=/srv/chiedi.ubuntu-it.org3WEB=/srv/chiedi.ubuntu-it.org
3WWW=$WEB/www/osqa/4WWW=$WEB/www/osqa/
4BZR=/srv/shared-branches5BZR=/srv/shared-branches
5BZRWWW=$BZR/ubuntu-it-ask/6BZRWWW=$BZR/ubuntu-it-ask/
6TMP_FILE=/tmp/askrepo_version7TMP_FILE=/tmp/askrepo_version
78
8cp -ax $BZRWWW/* $WWW/9function set_own_perm {
9 10 chown -R :ubuntu-it $WWW
10if ! test -f $TMP_FILE ; then11 chmod -R ug+rw $WWW
11 cat /dev/null > $TMP_FILE12}
13
14trap set_own_perm EXIT HUP QUIT TERM KILL
15
16if [ ! -f $TMP_FILE ]
17then
18 touch $TMP_FILE
12fi19fi
1320
14cd $BZRWWW21cd $BZRWWW
15VERSION=`cat $TMP_FILE`22OLD_VERSION=`cat $TMP_FILE`
16VERSION_TEST=`bzr up 2>&1 | tail -n1 `23NEW_VERSION=`bzr up 2>&1 | tail -n1`
1724
18if [ ! "$VERSION_TEST" = "$VERSION" ] ; then 25if [ ! "$NEW_VERSION" == "$OLD_VERSION" ]
19 echo "$VERSION_TEST" > $TMP_FILE26then
27 echo "$NEW_VERSION" > $TMP_FILE
28 cp -ax $BZRWWW/* $WWW/
20fi29fi
21
22
23
24
25

Subscribers

People subscribed via source and target branches