这段代码来自网络,亲测有效:
pgrep -x mysqld &> /dev/null
if [ $? -ne 0 ];then
bash /www/server/panel/script/rememory.sh
/etc/init.d/mysqld start
fi
下面这段代码时Ai优化过的
if ! pgrep -x mysqld &> /dev/null; then
/www/server/panel/script/rememory.sh
/etc/init.d/mysqld start
fi
但是还没试过
评论 (0)