annotate remote @ 20:0d65c3de34fd

add better logging
author carl
date Sun, 08 Jan 2006 12:36:57 -0800
parents 5dfe0138b4f9
children 2342081106d9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
d76f9ff42487 initial coding
carl
parents:
diff changeset
1 #!/bin/bash
d76f9ff42487 initial coding
carl
parents:
diff changeset
2
d76f9ff42487 initial coding
carl
parents:
diff changeset
3 function me()
d76f9ff42487 initial coding
carl
parents:
diff changeset
4 {
d76f9ff42487 initial coding
carl
parents:
diff changeset
5 a="$1"
d76f9ff42487 initial coding
carl
parents:
diff changeset
6 b="$2"
d76f9ff42487 initial coding
carl
parents:
diff changeset
7 echo "ssh $a $b"
d76f9ff42487 initial coding
carl
parents:
diff changeset
8 ssh $a "$b"
d76f9ff42487 initial coding
carl
parents:
diff changeset
9 }
d76f9ff42487 initial coding
carl
parents:
diff changeset
10
20
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
11 T=`grep AM_INIT_AUTOMAKE configure.in | cut -d'(' -f2`
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
12 NAME=`echo $T | cut -d, -f1`
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
13 VER=`echo $T | cut -d, -f2 | cut -d')' -f1`
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
14 BALL=$NAME-$VER.tar.gz
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
15 web=/home/httpd/html/510sg/$NAME
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
16 GZ=$web/packages/$BALL
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
17
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
18 t='ams ns1 mbmg'
9
d76f9ff42487 initial coding
carl
parents:
diff changeset
19 for i in $t; do
20
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
20 scp $GZ $i:/tmp
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
21 me $i "cd /tmp; tar xfz $BALL"
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
22 me $i "cd /tmp/$NAME-$VER; ./configure"
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
23 me $i "cd /tmp/$NAME-$VER; make"
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
24 me $i "cd /tmp/$NAME-$VER; make install"
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
25 me $i "/etc/rc.d/init.d/$NAME stop"
9
d76f9ff42487 initial coding
carl
parents:
diff changeset
26 me $i "/sbin/iptables -F INPUT"
20
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
27 me $i "cd /tmp/$NAME-$VER; make chkconfig"
10
5dfe0138b4f9 initial coding
carl
parents: 9
diff changeset
28 if [ -f remote.$i ]; then
20
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
29 scp remote.$i $i:/etc/$NAME.conf
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
30 else
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
31 scp /etc/$NAME.conf $i:/etc/$NAME.conf
10
5dfe0138b4f9 initial coding
carl
parents: 9
diff changeset
32 fi
20
0d65c3de34fd add better logging
carl
parents: 10
diff changeset
33 me $i "/etc/rc.d/init.d/$NAME start"
9
d76f9ff42487 initial coding
carl
parents:
diff changeset
34 done