Add DN42 fitter

This commit is contained in:
2025-11-03 15:51:48 +08:00
parent 02cbb8fc61
commit d6c621f38d
2 changed files with 2 additions and 25 deletions

View File

@@ -6,7 +6,8 @@ function unet_is_valid_network_v4() {
10.50.0.0/16+, 10.50.0.0/16+,
10.88.0.0/16+, 10.88.0.0/16+,
10.21.0.0/16+, 10.21.0.0/16+,
10.188.0.0/16+ 10.188.0.0/16+,
172.20.0.0/14+ #DN42转发器服务
]; ];
} }

View File

@@ -1,32 +1,8 @@
#!/bin/bash #!/bin/bash
rm /etc/bird/conf/dn42.conf
rm /etc/bird/function/dn42.conf
rm /etc/bird/net/dn42.conf
rm /etc/bird/peers/dn42 -rf
rm /etc/bird/function/unet.conf rm /etc/bird/function/unet.conf
curl https://git.nia.ink/brnet/bird_config/raw/branch/master/bird/function/unet.conf > /etc/bird/function/unet.conf curl https://git.nia.ink/brnet/bird_config/raw/branch/master/bird/function/unet.conf > /etc/bird/function/unet.conf
rm /etc/bird/bird.conf
curl https://git.nia.ink/brnet/bird_config/raw/branch/master/bird/bird.conf > /etc/bird/bird.conf
temp_file=$(mktemp)
awk '
BEGIN { delete_dn42 = 0 }
/^define DN42_ASN/ { delete_dn42 = 1 }
delete_dn42 == 0 { print $0 }
/^define UNET_ASN/ { delete_dn42 = 0; print $0 }
' /etc/bird/vars.conf > "$temp_file"
if [ -s "$temp_file" ]; then
mv "$temp_file" /etc/bird/vars.conf
echo "已成功删除 /etc/bird/vars.conf 中的DN42配置部分"
else
echo "处理出错,临时文件为空,未修改原文件"
rm "$temp_file"
fi
chmod -R 755 /etc/bird chmod -R 755 /etc/bird
birdc c birdc c