Create iperf3_server.sh

This commit is contained in:
Jensfrank 2024-07-04 16:56:21 +08:00 committed by GitHub
parent 9776b341e8
commit 5ccf30ad3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

13
iperf3_server.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# 检查 iperf3 是否安装
if ! command -v iperf3 &> /dev/null; then
echo "iperf3 未安装. 正在尝试安装..."
sudo apt-get update && sudo apt-get install -y iperf3 || sudo yum install -y iperf3
fi
# 启动 iperf3 服务器
echo "启动 iperf3 服务器..."
iperf3 -s -D
echo "iperf3 服务器已在后台启动。使用 'sudo killall iperf3' 来停止服务器。"