Files
bird_config/update.sh
2025-10-13 01:22:00 +08:00

22 lines
592 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
TABLE_NAME="ipv4_pub"
TABLE_ID=102
RT_TABLES="/etc/iproute2/rt_tables"
if ! grep -q "^${TABLE_ID}[[:space:]]\+${TABLE_NAME}" "$RT_TABLES"; then
echo "添加路由表 $TABLE_NAME(编号$TABLE_ID..."
echo "${TABLE_ID} ${TABLE_NAME}" >> "$RT_TABLES"
else
echo "路由表 $TABLE_NAME 已存在,无需创建"
fi
git clone https://git.nia.ink/brnet/bird_config.git
rm /etc/bird/bird.conf
rm /etc/bird/function/tables.conf
mv bird_config/bird.conf /etc/bird/bird.conf
mv bird_config/function/tables.conf /etc/bird/function/tables.conf
rm -rf bird_config
birdc c