Skip to content

Commit 109c870

Browse files
committed
first commit
1 parent 7fd0a34 commit 109c870

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

kill.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
#10002 is ip port
3+
name=$(lsof -i:10002|tail -1|awk '"$1"!=""{print $2}')
4+
if [ -z $name ]
5+
then
6+
echo "No process can be used to killed!"
7+
exit 0
8+
fi
9+
id=$(lsof -i:10002|tail -1|awk '"$1"!=""{print $2}')
10+
kill -9 $id
11+
12+
echo "Process name=$name($id) kill!"
13+
exit 0
14+

0 commit comments

Comments
 (0)