如mysql

 

cat check_mysql.sh

#!/bin/bash

servicename="mysqld"
showname="mysql" p status="${showname}_failed"
success_status="${showname}_success" function CheckPs(){ local ret=`pidof $pid | wc -l` echo $ret } if [ $(CheckPs) == 0 ]; then service $servicename restart sleep 1 if [ $(CheckPs) != 0 ]; then status=$success_status fi else status=$success_status fi echo $status

 

相关文章:

  • 2022-12-23
  • 2021-12-09
  • 2022-02-01
  • 2021-12-04
  • 2021-09-10
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2021-09-20
  • 2021-12-01
相关资源
相似解决方案