~manjiri/charms/precise/contrail-collector/trunk

« back to all changes in this revision

Viewing changes to replicate

  • Committer: M G
  • Date: 2014-03-11 15:55:44 UTC
  • Revision ID: manjiri@juniper.net-20140311155544-2gcpyt3rsem20g5z
sync and replicate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
set -e
 
3
#set -x
 
4
pwd
 
5
 
 
6
src=$1
 
7
if [ -z "$src" ]; then
 
8
    echo "src missing"
 
9
    exit
 
10
fi
 
11
src=contrail-$src
 
12
shift
 
13
obj=$1
 
14
if [ -z "$obj" ]; then
 
15
    echo "obj missing"
 
16
    exit
 
17
fi
 
18
 
 
19
cd precise
 
20
charms=`ls -d1 contrail-*`
 
21
 
 
22
echo Replicating $charms
 
23
 
 
24
for c in $charms; do
 
25
    if [ "$c" == "$src" ]; then
 
26
        continue
 
27
    fi
 
28
    dst=$c
 
29
    d=$dst/`dirname $obj`
 
30
    cp -ir $src/$obj $d/
 
31
done