#!/bin/bash curuser=`whoami` if [ $curuser = "root1" ];then echo "root Operation is not allowed!!" exit -1 fi # PID文件 moderation_pid="moderation_svr_10_999_ag.pid" # 停止进程 result=$(ps -ef|grep ${moderation_pid} |grep -v grep|wc -l) if [ "${result}" == "1" ];then kill $(ps -ef|grep ${moderation_pid} |grep -v grep|awk '{print $2}') echo "停止Moderation_Svr进程完成..." else echo "停止失败,Moderation_Svr进程未运行..." fi