终止alphatrader脚本

来源:互联网 发布:数据库系统教程答案 编辑:程序博客网 时间:2024/06/02 14:39
#!/sbin/sh#author whh#edition 1.0isrunning(){ps -ef|grep $1|grep -v grepif(($? != 0));thenecho "################Terminate Error###############"echo "$1 is not running"echo "##############################################"exitfi}terminate_env(){if['whoami' != root];thenecho "Must be logged on as root to run this script"exitfi#输出换行echo ""#检查alphatrader相关进程是否运行echo "The processes who are going to be killed are listed here"isrunning ./atbusserviceisrunning ./alphatrader_taskisrunning ./alphatraderserviceisrunning ./atgatewayserviceisrunning ./atquoteserviceisrunning ./atmonitorservice#输出换行echo ""}terminate(){ps -ef | grep ./at | grep service | cut -c 9-15 | xargs kill -9ps -ef | grep ./alphatrader | grep -v grep | cut -c 9-15 | xargs kill -9}main(){terminate_envecho "Trying to Terminate Alphatrader ..."terminateecho "Terminate Alphatrader Successfully"}mainexit 0

亮点自寻【批量杀死进程,带参函数的使用】

0 0
原创粉丝点击