2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 13:47:15 +08:00

feat: 自动开启 BBR

This commit is contained in:
耗子
2024-01-12 22:45:20 +08:00
parent c0db1cf993
commit c7ad1a1435

View File

@@ -110,6 +110,15 @@ Prepare_System() {
echo fs.file-max = 6553560 >> /etc/sysctl.conf
fi
# 自动开启 BBR
isBBRSupported=$(sysctl net.ipv4.tcp_available_congestion_control | grep -c bbr)
if [ "${isBBRSupported}" != "0" ]; then
qdisc=$(sysctl net.core.default_qdisc | awk '{print $3}')
echo "net.core.default_qdisc=${qdisc}" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
fi
if [ "${OS}" == "centos" ]; then
if ${inChina}; then
sed -e 's|^mirrorlist=|#mirrorlist=|g' \