diff --git a/test/connection/stop.sh b/test/connection/stop.sh new file mode 100755 index 0000000..2492dd7 --- /dev/null +++ b/test/connection/stop.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +PORT=8888 +PID=$(lsof -t -i:$PORT) + +if [ -n "$PID" ]; then + echo "找到端口 $PORT 的进程: PID=$PID" + kill -9 $PID + echo "已终止端口 $PORT 的进程" +else + echo "未找到端口 $PORT 的进程" +fi \ No newline at end of file diff --git a/test/entities/stop.sh b/test/entities/stop.sh new file mode 100755 index 0000000..d3e21d0 --- /dev/null +++ b/test/entities/stop.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +PORT=9990 +PID=$(lsof -t -i:$PORT) + +if [ -n "$PID" ]; then + echo "找到端口 $PORT 的进程: PID=$PID" + kill -9 $PID + echo "已终止端口 $PORT 的进程" +else + echo "未找到端口 $PORT 的进程" +fi \ No newline at end of file