#!/bin/bash
name="search"
allip="0 1 2 3 4 5 6 7 8 9 sys"
alltype="master slave"
#allip="indexserver0 indexserver1"
dir=/home/search/
if [[ $1 == "" ]]; then
echo "Bad usage,like:"
echo "deploy|start|stop [servername{0|1|2|3|4|5|6|7|8|9|sys}] [type{master|slave}]"
exit
fi
if [[ $2 != "" ]] && [[ $3 != "" ]]; then
allip=$2
alltype=$3
#echo $allip
fi
case $1 in
deploy) remoteip=$allip
command="deploy.sh"
;;
start) remoteip=$allip
command="start.sh"
;;
stop) remoteip=$allip
command="stop.sh"
;;
esac
for type in $alltype; do
for ip in $allip; do
echo ssh $name$type$ip $dir$name$type/$command
ssh $name$type$ip $dir$name$type/$command
sleep 5
done
sleep 30
done
阅读(2837) | 评论(0) | 转发(2) |