首页 > 其他 > 详细

startallserver

时间:2014-06-05 11:06:49      阅读:476      评论:0      收藏:0      [点我收藏+]
[lvhongmin@AY1401201736089361adZ start_svr]$ cat startall_svr.sh 
#!/bin/bash

errpath[0]=‘‘
errnum=0
runnum=0
curr_path=`pwd`

#启动各进程的脚本完整路径及名字

array[${#array[*]}]=/home/lvhongmin/bin/bin.gatemaster/restart_proxy
slp[${#slp[*]}]=5   
array[${#array[*]}]=/home/lvhongmin/bin/bin.connect/restart_proxy
slp[${#slp[*]}]=2
array[${#array[*]}]=/home/lvhongmin/bin/bin.ss.hall/restart_proxy
slp[${#slp[*]}]=2
array[${#array[*]}]=/home/lvhongmin/bin/bin.cornucopia/go.lhm.cornucopia
slp[${#slp[*]}]=2
array[${#array[*]}]=/home/lvhongmin/bin/bin.ddz.match/go.lhm.ddz.match
slp[${#slp[*]}]=2
array[${#array[*]}]=/home/lvhongmin/bin/bin.ddz.pt/go.lhm.ddz.pt
slp[${#slp[*]}]=2
array[${#array[*]}]=/home/lvhongmin/bin/bin.horse/go.lhm.horse
slp[${#slp[*]}]=2
array[${#array[*]}]=/home/lvhongmin/bin/bin.hsz.pt/go.lhm.hsz.pt
slp[${#slp[*]}]=2
array[${#array[*]}]=/home/lvhongmin/bin/bin.jpwl.pt/go.lhm.jpwl.pt
slp[${#slp[*]}]=2
array[${#array[*]}]=/home/lvhongmin/bin/bin.lzddz.pt/go.lhm.lzddz.pt
slp[${#slp[*]}]=2
array[${#array[*]}]=/home/lvhongmin/bin/bin.pklottery/go.lhm.pklottery
slp[${#slp[*]}]=2
array[${#array[*]}]=/home/lvhongmin/bin/bin.six/go.lhm.six
slp[${#slp[*]}]=1
array[${#array[*]}]=/home/lvhongmin/bin/bin.record.lhm/go.lhm.record.svr
slp[${#slp[*]}]=1

#declare -a array
len=${#array[*]}
echo "server num=" $len

for((i=0; i<$len;i++ ))
do
#  echo ${array[$i]}
  exen=${array[$i]}
  slpnum=${slp[$i]}
  if [ -f $exen  ]; then

       echo  ${exen} ‘  >> ‘ $slpnum

      #get the path

       fpath=${exen%/*}

       echo $fpath 

      # go to the path

       cd $fpath

       ${exen}

      #use proper sleep time

       sleep $slpnum
       runnum=`expr $runnum + 1`
   else
       echo ‘  --‘ $exen
       errpathn[$unnum]=$exen    
       errnum=`expr $errnum + 1`   
   fi
done

cd $curr_path

startallserver,布布扣,bubuko.com

startallserver

原文:http://blog.csdn.net/wusthongmin/article/details/27494753

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!