/[Sack]/trunk/bin/cloud-lib.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

Contents of /trunk/bin/cloud-lib.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 27 - (show annotations)
Tue Sep 22 21:58:12 2009 UTC (14 years, 8 months ago) by dpavlin
File MIME type: application/x-sh
File size: 1116 byte(s)
shell script to startup sack cloud
1 #!/bin/sh -x
2
3 port=3000
4 offset=0
5 limit=25000
6 connect=
7
8 hostname=`hostname -s`
9
10 update=$1
11
12 function node {
13
14 if [ ! -z "$update" ] ; then
15 echo "update $1:$2"
16 ssh $1 $2/srv/Sack/bin/install-debian.sh || exit
17 ssh $1 killall sack.pl
18 rsync -rav --exclude 'out/*' /virtual/webpac2.rot13.org/export/srv/Sack/ $1:/$2/srv/Sack/
19 rsync -rav --exclude 'out/*' --exclude 'var/*' /virtual/webpac2.rot13.org/export/srv/webpac2/ $1:/$2/srv/webpac2/
20 fi
21
22 ssh="ssh -L $port:localhost:$port $1"
23 test "$hostname" == $1 && ssh=""
24
25 echo "## $1 $port $offset $limit [$ssh]"
26
27 $ssh $2/srv/Sack/bin/sack.pl --listen $port --limit $limit --offset $offset &
28 connect="$connect --connect 127.0.0.1:$port"
29
30 sleep 1
31
32 port=`expr $port + 1`
33 offset=`expr $offset + $limit`
34 }
35
36
37 node mlin /virtual/webpac2.rot13.org/export/
38 node mlin /virtual/webpac2.rot13.org/export/
39 node opr /virtual/webpac2.rot13.org/export/
40 node opr /virtual/webpac2.rot13.org/export/
41 #node klin /virtual/webpac2.rot13.org/export/
42
43
44 echo "## lorry $connect"
45 cd /virtual/webpac2.rot13.org/export/srv/Sack ; ./bin/sack.pl $connect --limit $limit --offset $offset

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26