/[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

Contents of /trunk/bin/cloud.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 77 - (show annotations)
Fri Sep 25 21:13:25 2009 UTC (14 years, 8 months ago) by dpavlin
File MIME type: application/x-sh
File size: 1502 byte(s)
use separate ssh session for sacks
1 #!/bin/sh
2
3 port=4000
4 offset=0
5 limit=25000
6 connect=
7
8 v=
9
10 #v='-v'
11 v='-C -v'
12 limit=1000
13
14 hostname=`hostname -s`
15
16 update=$1
17
18 prefix=`pwd | sed 's!/*/srv/Sack.*$!!'`
19
20 function node {
21
22 if [ ! -z "$update" ] ; then
23 echo "# update $1:$2 from $prefix"
24 rsync -rav --exclude 'out/*' $prefix/srv/Sack/ $1:/$2/srv/Sack/
25 rsync -rav --exclude 'out/*' --exclude 'var/*' $prefix/srv/webpac2/ $1:/$2/srv/webpac2/
26 ssh $1 $2/srv/Sack/bin/install-debian.sh || exit
27 return
28 fi
29
30 ssh="ssh $v -S /tmp/sack.$1.ssh -L $port:127.0.0.1:$port $1"
31 test "$hostname" == $1 && ssh=""
32
33 echo 0 exit | nc localhost $port
34 ssh $1 "echo 0 exit | nc 127.0.0.1 $port ; killall sack.pl"
35
36 full="$ssh $2/srv/Sack/bin/sack.pl --listen $port --limit $limit --offset $offset"
37 echo "# node $1 # $full"
38
39 if [ ! -z "$DISPLAY" ] ; then
40 xterm -T "$1 $port" -e $full &
41 else
42 $full &
43 fi
44 connect="$connect --connect $port"
45
46 port=`expr $port + 1`
47 offset=`expr $offset + $limit`
48 }
49
50 rm /dev/shm/sack.*
51
52 if [ $hostname == 't61p' ] ; then
53 node tab.lan /
54 node tab.lan /
55 node x200.lan /
56 # node x200.lan /
57 node t61p /
58 else
59 echo "# .lib";
60 node mlin /virtual/webpac2.rot13.org/export/
61 node mlin /virtual/webpac2.rot13.org/export/
62 node opr /virtual/webpac2.rot13.org/export/
63 node opr /virtual/webpac2.rot13.org/export/
64 node klin /virtual/webpac2.rot13.org/export/
65 fi
66
67
68 echo "## lorry wating..."
69 sleep 1
70 echo "## ... $connect";
71 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