#! /bin/bash

#kill 所有kitchen 进程
iplist=(
10.130.2.245

)


function killkitchen()
{
pid=`ps aux | grep kitchen.sh | awk '{ if ($11!=grep) {print $2;}}'| wc -l`
if [[ $pid -gt 1 ]]
then
kill -9 $(ps aux | grep kitchen.sh | awk '{ if ($11!=grep) {print $2;}}')
else
echo successful
fi

}

for host in ${iplist[*]};
do
killkitchen $host
done

posted on 2017-04-10 19:46  流浪在伯纳乌  阅读(429)  评论(0编辑  收藏  举报