9
|
1 #!/bin/bash
|
|
2
|
|
3 function me()
|
|
4 {
|
|
5 a="$1"
|
|
6 b="$2"
|
|
7 echo "ssh $a $b"
|
|
8 ssh $a "$b"
|
|
9 }
|
|
10
|
20
|
11 T=`grep AM_INIT_AUTOMAKE configure.in | cut -d'(' -f2`
|
|
12 NAME=`echo $T | cut -d, -f1`
|
|
13 VER=`echo $T | cut -d, -f2 | cut -d')' -f1`
|
|
14 BALL=$NAME-$VER.tar.gz
|
|
15 web=/home/httpd/html/510sg/$NAME
|
|
16 GZ=$web/packages/$BALL
|
|
17
|
|
18 t='ams ns1 mbmg'
|
9
|
19 for i in $t; do
|
20
|
20 scp $GZ $i:/tmp
|
|
21 me $i "cd /tmp; tar xfz $BALL"
|
|
22 me $i "cd /tmp/$NAME-$VER; ./configure"
|
|
23 me $i "cd /tmp/$NAME-$VER; make"
|
|
24 me $i "cd /tmp/$NAME-$VER; make install"
|
|
25 me $i "/etc/rc.d/init.d/$NAME stop"
|
9
|
26 me $i "/sbin/iptables -F INPUT"
|
20
|
27 me $i "cd /tmp/$NAME-$VER; make chkconfig"
|
10
|
28 if [ -f remote.$i ]; then
|
20
|
29 scp remote.$i $i:/etc/$NAME.conf
|
|
30 else
|
|
31 scp /etc/$NAME.conf $i:/etc/$NAME.conf
|
10
|
32 fi
|
21
|
33 me $i "ln --symbolic --force /etc/$NAME.conf /usr/local/etc/$NAME.conf"
|
20
|
34 me $i "/etc/rc.d/init.d/$NAME start"
|
9
|
35 done
|