Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
website
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Ask
website
Commits
8efd147d
Commit
8efd147d
authored
Mar 26, 2013
by
Milo Casagrande
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reworked cronjob: added exit funxtion, samll tweaks.
parent
e51a13f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
cronjob
cronjob
+17
-13
No files found.
cronjob
View file @
8efd147d
#!/bin/bash
#!/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
BZR
=
/srv/shared-branches
BZRWWW
=
$BZR
/ubuntu-it-ask/
BZRWWW
=
$BZR
/ubuntu-it-ask/
TMP_FILE
=
/tmp/askrepo_version
TMP_FILE
=
/tmp/askrepo_version
cp
-ax
$BZRWWW
/
*
$WWW
/
function
set_own_perm
{
chown
-R
:ubuntu-it
$WWW
if
!
test
-f
$TMP_FILE
;
then
chmod
-R
ug+rw
$WWW
cat
/dev/null
>
$TMP_FILE
}
fi
cd
$BZRWWW
trap
set_own_perm EXIT HUP QUIT TERM KILL
VERSION
=
`
cat
$TMP_FILE
`
VERSION_TEST
=
`
bzr up 2>&1 |
tail
-n1
`
if
[
!
"
$VERSION_TEST
"
=
"
$VERSION
"
]
;
then
if
[
!
-f
$TMP_FILE
]
echo
"
$VERSION_TEST
"
>
$TMP_FILE
then
touch
$TMP_FILE
fi
fi
cd
$BZRWWW
OLD_VERSION
=
`
cat
$TMP_FILE
`
NEW_VERSION
=
`
bzr up 2>&1 |
tail
-n1
`
if
[
!
"
$NEW_VERSION
"
==
"
$OLD_VERSION
"
]
then
echo
"
$NEW_VERSION
"
>
$TMP_FILE
cp
-ax
$BZRWWW
/
*
$WWW
/
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment