2行为项目名称
12行为应用启动命令
1 #!/bin/bash 2 name= dmserver 3 echo ------------------------ 4 echo "ps -ef | grep dmserver | grep -v "grep" | wc -l" 5 while true 6 do 7 count=`ps -ef | grep dmserver | grep -v "grep" | wc -l` 8 echo $count 9 if [ $count == 0 ];then 10 echo "监听:$name," $(date +"%Y-%m-%d %H:%M:%S") "服务不存在" 11 echo 执行命令 service dmserver start 12 `service dmserver start` 13 else 14 echo "监听:$name," $(date +"%Y-%m-%d %H:%M:%S") "服务存在" 15 fi 16 sleep 3 17 done标签:脚本,-%,grep,name,count,echo,监控,dmserver,达梦 From: https://www.cnblogs.com/mytzq/p/16848241.html