Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # dasscm_remote_update is intended for systems
|
---|
4 | # where a local dasscm installation is not possible
|
---|
5 | # but ssh and rsync is available.
|
---|
6 | # In this case,
|
---|
7 | # the files from the local repository checkout
|
---|
8 | # are updated to the current content.
|
---|
9 | # Use only, if a local dasscm installation is not possbile!
|
---|
10 |
|
---|
11 | set -o errexit -o nounset
|
---|
12 |
|
---|
13 | usage()
|
---|
14 | {
|
---|
15 | echo "
|
---|
16 | usage: $0 hostname
|
---|
17 | hostname must be identical with the repository path
|
---|
18 | "
|
---|
19 | exit 1
|
---|
20 | }
|
---|
21 |
|
---|
22 | OPTIONS=${DASSCM_RSYNC_OPTIONS:-""}
|
---|
23 | REMOTE_USER=${DASSCM_REMOTE_USER:-"root"}
|
---|
24 |
|
---|
25 | SERVER=$1
|
---|
26 |
|
---|
27 | if [ -z "$SERVER" ]; then
|
---|
28 | usage
|
---|
29 | fi
|
---|
30 |
|
---|
31 | if [ ! -d "$SERVER" ]; then
|
---|
32 | echo
|
---|
33 | echo " failed to access directory $SERVER"
|
---|
34 | usage
|
---|
35 | fi
|
---|
36 |
|
---|
37 | # start at an current repository checkout of morbo.
|
---|
38 | # only already existing files will be updated.
|
---|
39 | # If you want to add more files,
|
---|
40 | # create the file in the repository and re-run this script
|
---|
41 | cd $SERVER
|
---|
42 | svn up || (echo "failed to update repository $SERVER"; usage)
|
---|
43 | FILELIST=`mktemp`
|
---|
44 | find > $FILELIST
|
---|
45 | rsync -av --existing --files-from $FILELIST $OPTIONS $REMOTE_USER@$SERVER:/. . || (echo "FAILED to transfer dasscm files. Failed to access server $SERVER via ssh/rsync?"; usage)
|
---|
46 | rm $FILELIST
|
---|
47 | echo "updated file must be commited manually"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.