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