/[Sack]/trunk/bin/cloud.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/bin/cloud.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62 - (hide annotations)
Fri Sep 25 13:16:04 2009 UTC (14 years, 8 months ago) by dpavlin
File MIME type: application/x-sh
File size: 1220 byte(s)
make general cloud.sh starter
1 dpavlin 29 #!/bin/sh
2 dpavlin 27
3 dpavlin 62 port=4000
4 dpavlin 27 offset=0
5     limit=25000
6     connect=
7    
8 dpavlin 62 v=
9     v='-v'
10    
11 dpavlin 27 hostname=`hostname -s`
12    
13     update=$1
14    
15 dpavlin 62 prefix=`pwd | sed 's!/*/srv/Sack.*$!!'`
16    
17 dpavlin 27 function node {
18    
19     if [ ! -z "$update" ] ; then
20 dpavlin 62 echo "# update $1:$2 from $prefix"
21     rsync -rav --exclude 'out/*' $prefix/srv/Sack/ $1:/$2/srv/Sack/
22     rsync -rav --exclude 'out/*' --exclude 'var/*' $prefix/srv/webpac2/ $1:/$2/srv/webpac2/
23 dpavlin 27 ssh $1 $2/srv/Sack/bin/install-debian.sh || exit
24     ssh $1 killall sack.pl
25     fi
26    
27 dpavlin 62 ssh="ssh -L $port:127.0.0.1:$port $1"
28 dpavlin 27 test "$hostname" == $1 && ssh=""
29    
30 dpavlin 62 echo "# node $1 [$ssh] $offset $limit"
31 dpavlin 27
32 dpavlin 62 $ssh $v $2/srv/Sack/bin/sack.pl --listen $port --limit $limit --offset $offset &
33 dpavlin 27 connect="$connect --connect 127.0.0.1:$port"
34    
35     port=`expr $port + 1`
36     offset=`expr $offset + $limit`
37     }
38    
39 dpavlin 62 if [ $hostname == 't61p' ] ; then
40     node tab /
41     else
42     echo "# .lib";
43     node mlin /virtual/webpac2.rot13.org/export/
44     node mlin /virtual/webpac2.rot13.org/export/
45     node opr /virtual/webpac2.rot13.org/export/
46     node opr /virtual/webpac2.rot13.org/export/
47     node klin /virtual/webpac2.rot13.org/export/
48     fi
49 dpavlin 27
50    
51 dpavlin 62 echo "## lorry wating..."
52     sleep 1
53     echo "## ... $connect";
54     cd $prefix/srv/Sack ; ./bin/sack.pl $connect --limit $limit --offset $offset

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26