脚本_通过进程与端口判断myslq服务
#!bin/bash
if [[ $port -eq 1 || $porcess -eq 2 ]];then #通过条件判断端口和进程执行的返回值.
echo "mysql is starting"
else
echo "mysql is stop"
/etc/init.d/mysqld start #如果服务是停止的,则启动服务.
fi
#!bin/bash
if [[ $port -eq 1 || $porcess -eq 2 ]];then #通过条件判断端口和进程执行的返回值.
echo "mysql is starting"
else
echo "mysql is stop"
/etc/init.d/mysqld start #如果服务是停止的,则启动服务.
fi