Skip to content

Instantly share code, notes, and snippets.

@zsnmwy
Last active January 27, 2019 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zsnmwy/b220d1085d380f2b9b6cfdaf24afa1ce to your computer and use it in GitHub Desktop.
Save zsnmwy/b220d1085d380f2b9b6cfdaf24afa1ce to your computer and use it in GitHub Desktop.
bbr
#检测安装完成或失败
judge(){
if [[ $? -eq 0 ]];then
echo -e "${OK} ${GreenBG} $1 完成 ${Font}"
sleep 1
else
echo -e "${Error} ${RedBG} $1 失败${Font}"
exit 1
fi
}
rinetdbbr_install(){
export RINET_URL="https://github.com/dylanbai8/V2Ray_ws-tls_Website_onekey/raw/master/bbr/rinetd_bbr_powered"
IFACE=$(ip -4 addr | awk '{if ($1 ~ /inet/ && $NF ~ /^[ve]/) {a=$NF}} END{print a}')
curl -L "${RINET_URL}" >/usr/bin/rinetd-bbr
chmod +x /usr/bin/rinetd-bbr
judge "rinetd-bbr 安装"
touch /etc/rinetd-bbr.conf
cat <<EOF >> /etc/rinetd-bbr.conf
0.0.0.0 ${port} 0.0.0.0 ${port}
EOF
touch /etc/systemd/system/rinetd-bbr.service
cat <<EOF > /etc/systemd/system/rinetd-bbr.service
[Unit]
Description=rinetd with bbr
[Service]
ExecStart=/usr/bin/rinetd-bbr -f -c /etc/rinetd-bbr.conf raw ${IFACE}
Restart=always
User=root
[Install]
WantedBy=multi-user.target
EOF
judge "rinetd-bbr 自启动配置"
systemctl enable rinetd-bbr >/dev/null 2>&1
systemctl start rinetd-bbr
judge "rinetd-bbr 启动"
}
rinetdbbr_install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment