Update Nlbench_beta.sh

This commit is contained in:
Jensfrank 2024-07-05 13:51:22 +08:00 committed by GitHub
parent d291d70259
commit 5f3af04441
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,19 +51,16 @@ install_dependencies() {
clear clear
} }
# 获取IP地址和ISP信息
ip_address_and_isp() { ip_address_and_isp() {
ipv4_address=$(curl -s --max-time 5 ipv4.ip.sb) ipv4_address=$(curl -s --max-time 5 -4 ip.sb)
ipv6_address=$(curl -s --max-time 5 ipv6.ip.sb) ipv6_address=$(curl -s --max-time 5 -6 ip.sb)
# 获取ISP信息 # 获取ISP信息
isp_info=$(curl -s ipinfo.io/org) isp_info=$(curl -s ipinfo.io/org)
isp=$(echo "$isp_info" | grep -oP '(?<="org":")[^"]*')
asn=$(echo "$isp_info" | grep -oP '(?<="asn":")[^"]*')
# 检查是否为WARP或Cloudflare # 检查是否为WARP或Cloudflare
is_warp=false is_warp=false
if echo "$isp $asn" | grep -iq "cloudflare\|warp\|1.1.1.1"; then if echo "$isp_info" | grep -iq "cloudflare\|warp\|1.1.1.1"; then
is_warp=true is_warp=true
fi fi
@ -75,6 +72,7 @@ ip_address_and_isp() {
echo "IPv4: $ipv4_address" echo "IPv4: $ipv4_address"
echo "IPv6: $ipv6_address" echo "IPv6: $ipv6_address"
echo "ISP: $isp_info"
echo "Is WARP: $is_warp" echo "Is WARP: $is_warp"
echo "Use IPv6: $use_ipv6" echo "Use IPv6: $use_ipv6"
} }
@ -203,8 +201,8 @@ run_script() {
sed -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file" sed -i 's/\x1B\[[0-9;]*[JKmsu]//g' "$temp_file"
cp "$temp_file" "${output_file}_response" cp "$temp_file" "${output_file}_response"
;; ;;
# 多线程测速 # 多线程测速
6) 6)
echo -e "运行${YELLOW}多线程测速...${NC}" echo -e "运行${YELLOW}多线程测速...${NC}"
if [ "$use_ipv6" = true ]; then if [ "$use_ipv6" = true ]; then
echo "使用IPv6测试选项" echo "使用IPv6测试选项"
@ -219,8 +217,8 @@ run_script() {
sed -i -r '/测试进行中/d' "$temp_file" sed -i -r '/测试进行中/d' "$temp_file"
cp "$temp_file" "${output_file}_multi_thread" cp "$temp_file" "${output_file}_multi_thread"
;; ;;
# 单线程测速 # 单线程测速
7) 7)
echo -e "运行${YELLOW}单线程测速...${NC}" echo -e "运行${YELLOW}单线程测速...${NC}"
if [ "$use_ipv6" = true ]; then if [ "$use_ipv6" = true ]; then
echo "使用IPv6测试选项" echo "使用IPv6测试选项"
@ -243,8 +241,8 @@ run_script() {
sed -i -r '1,/\[ ID\] /d' "$temp_file" sed -i -r '1,/\[ ID\] /d' "$temp_file"
cp "$temp_file" "${output_file}_iperf3" cp "$temp_file" "${output_file}_iperf3"
;; ;;
# 回程路由 # 回程路由
9) 9)
echo -e "运行${YELLOW}回程路由测试...${NC}" echo -e "运行${YELLOW}回程路由测试...${NC}"
if [ "$use_ipv6" = true ]; then if [ "$use_ipv6" = true ]; then
echo "使用IPv6测试选项" echo "使用IPv6测试选项"