Skip to content
This repository was archived by the owner on Dec 1, 2022. It is now read-only.

Commit 351f4c5

Browse files
authored
Merge pull request #35 from soffchen/patch-1
trim parameters in sysctl.conf
2 parents a487642 + 713f722 commit 351f4c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tcp.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ check_status(){
629629
run_status="未安装加速模块"
630630
fi
631631
elif [[ ${kernel_status} == "BBR" ]]; then
632-
run_status=`grep "net.ipv4.tcp_congestion_control" /etc/sysctl.conf | awk -F "=" '{print $2}'`
632+
run_status=`grep "net.ipv4.tcp_congestion_control" /etc/sysctl.conf | awk -F "=" '{gsub("^[ \t]+|[ \t]+$", "", $2);print $2}'`
633633
if [[ ${run_status} == "bbr" ]]; then
634634
run_status=`lsmod | grep "bbr" | awk '{print $1}'`
635635
if [[ ${run_status} == "tcp_bbr" ]]; then
@@ -655,7 +655,7 @@ check_status(){
655655
run_status="未安装加速模块"
656656
fi
657657
elif [[ ${kernel_status} == "BBRplus" ]]; then
658-
run_status=`grep "net.ipv4.tcp_congestion_control" /etc/sysctl.conf | awk -F "=" '{print $2}'`
658+
run_status=`grep "net.ipv4.tcp_congestion_control" /etc/sysctl.conf | awk -F "=" '{gsub("^[ \t]+|[ \t]+$", "", $2);print $2}'`
659659
if [[ ${run_status} == "bbrplus" ]]; then
660660
run_status=`lsmod | grep "bbrplus" | awk '{print $1}'`
661661
if [[ ${run_status} == "tcp_bbrplus" ]]; then

0 commit comments

Comments
 (0)