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
|
22
|
20 echo " installing on $i"
|
20
|
21 scp $GZ $i:/tmp
|
|
22 me $i "cd /tmp; tar xfz $BALL"
|
|
23 me $i "cd /tmp/$NAME-$VER; ./configure"
|
|
24 me $i "cd /tmp/$NAME-$VER; make"
|
|
25 me $i "cd /tmp/$NAME-$VER; make install"
|
|
26 me $i "/etc/rc.d/init.d/$NAME stop"
|
9
|
27 me $i "/sbin/iptables -F INPUT"
|
20
|
28 me $i "cd /tmp/$NAME-$VER; make chkconfig"
|
21
|
29 me $i "ln --symbolic --force /etc/$NAME.conf /usr/local/etc/$NAME.conf"
|
20
|
30 me $i "/etc/rc.d/init.d/$NAME start"
|
22
|
31
|
|
32 echo " install done on $i, press enter to continue"
|
|
33 read a
|
9
|
34 done
|