#!/bin/bash
pid=$(ps -aux|grep $1 |awk '{print $2}'|wc -l)
if [ $pid -gt 3 ];then
ps -aux|grep $1 |grep java |awk 'NR==1{print $2}'|xargs kill -9
fi
#!/bin/bash
echo $1
pid=`sudo lsof -t -i:$1`
echo $pid
if [ $pid -ne 0 ];then
kill -9 $pid
fi