#! /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
时间: 2024-11-04 18:41:23