Skip to content

Commit 0da6ac3

Browse files
committed
fix: bbr fail in archlinux; fish.py escape invalid
Signed-off-by: lxl66566 <[email protected]>
1 parent f381b36 commit 0da6ac3

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

external_scripts/bbr.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ enable_bbr() {
3131
fi
3232

3333
# 启用 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
3637

3738
# 应用新的配置
39+
modprobe tcp_bbr || true
3840
sysctl -p
3941

4042
# 再次检查是否成功启用 BBR

init-script/install/__init__.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -604,14 +604,20 @@ def pre_install_caddy():
604604
)
605605
)
606606

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+
607615
packages_list.add(
608616
Package(
609617
"bbr",
610618
level=2,
611619
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,
615621
)
616622
)
617623

init-script/install/fish.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
def install_fish_on_debian():
1111
url = "https://download.opensuse.org/repositories/shells:/fish:/nightly:/master/Debian_10/amd64/"
1212
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""",
1414
capture_output=True,
1515
text=True,
1616
).stdout.strip() # type: ignore

0 commit comments

Comments
 (0)