22 lines
592 B
Bash
22 lines
592 B
Bash
#!/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 |