---
panlei
2019-12-13 596fe167e4bdba16b68ad9951bec0f2b077e0122
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
 
while true
do
    number=`ps -ef | grep "ruleprocess" |grep -v "grep" | wc -l`
    echo $number
    if [ $number -eq 0 ];then
      cd /home/basic/workspace/gitblit/ruleprocess
      nohup ./ruleprocess &
      echo `date +%Y-%m-%d` `date +%H:%M:%S`  "restart 服务" >> restart.log
    else
      echo "hello"
    fi
    sleep 3
done