• #!/bin/bash
  • #截取httped进程,并把结果赋予变量test
  • test=$(ps -aux | grep "httpd" | grep -v "grep")
  • #如果test的值不为空,则执行then中命令
  • if [ -n $"test" ]
  • then
  • echo "$(date) httped is ok!" >> /tmp/autostart-acc.log
  • else
  • /etc/rc.d/init.d/httpd start &> /dev/null
  • echo "$(date) restart httpd !" >> /tmp/autostart-err.log
  • fi

相关文章:

  • 2022-12-23
  • 2021-08-24
  • 2022-12-23
  • 2022-02-23
  • 2021-08-18
  • 2021-11-21
  • 2021-06-16
  • 2021-05-27
猜你喜欢
  • 2022-12-23
  • 2021-12-15
  • 2021-06-28
  • 2022-01-30
  • 2021-09-13
  • 2022-12-23
  • 2021-07-08
相关资源
相似解决方案