Check process case

来源:互联网 发布:帝霸传奇手游源码 编辑:程序博客网 时间:2024/06/05 17:08

1:Check ports

#!/bin/bash 
set - e
set - x

if (netstat -nltp |grep 1935) == 0
  then echo "SRS Oringin start failed" >> /tmp/failed_start_service.log
    else echo  "SRS Oringin start"


2:Check process name

#/bin/bash


if ps aux |grep admin/|grep conf >/dev/null
then
echo -e "\033[33m admin started \033[0m"
else
echo -e "\033[41m Service admin start failed \033[0m"
fi

0 0