Commit 0da6ac3 1 parent f381b36 commit 0da6ac3 Copy full SHA for 0da6ac3
File tree 3 files changed +14
-6
lines changed
3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,12 @@ enable_bbr() {
31
31
fi
32
32
33
33
# 启用 BBR
34
- echo " net.core.default_qdisc=fq" >> /etc/sysctl.conf
35
- echo " net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
34
+ rm -f /etc/sysctl.d/bbr.conf
35
+ echo " net.core.default_qdisc=fq" >> /etc/sysctl.d/bbr.conf
36
+ echo " net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.d/bbr.conf
36
37
37
38
# 应用新的配置
39
+ modprobe tcp_bbr || true
38
40
sysctl -p
39
41
40
42
# 再次检查是否成功启用 BBR
Original file line number Diff line number Diff line change @@ -604,14 +604,20 @@ def pre_install_caddy():
604
604
)
605
605
)
606
606
607
+
608
+ def install_bbr ():
609
+ rc_sudo (
610
+ f'bash { Path (__file__ ).parent .parent .parent / "external_scripts/bbr.sh" } ' ,
611
+ check = False ,
612
+ )
613
+
614
+
607
615
packages_list .add (
608
616
Package (
609
617
"bbr" ,
610
618
level = 2 ,
611
619
pre_install_fun = lambda : True ,
612
- install_fun = lambda : rc_sudo (
613
- f'bash { Path (__file__ ).parent .parent .parent / "external_scripts/bbr.sh" } '
614
- ),
620
+ install_fun = install_bbr ,
615
621
)
616
622
)
617
623
Original file line number Diff line number Diff line change 10
10
def install_fish_on_debian ():
11
11
url = "https://download.opensuse.org/repositories/shells:/fish:/nightly:/master/Debian_10/amd64/"
12
12
package_name = rc (
13
- f """curl { url } | grep -Po "fish_3\..*?\.deb?" | tail -1""" ,
13
+ rf """curl { url } | grep -Po "fish_3\..*?\.deb?" | tail -1""" ,
14
14
capture_output = True ,
15
15
text = True ,
16
16
).stdout .strip () # type: ignore
You can’t perform that action at this time.
0 commit comments