PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/bondingshouldbefree/bsbf-resources.git
-PKG_SOURCE_DATE:=2026-05-14
-PKG_SOURCE_VERSION:=3eece0a10ff73ca94bdedeacd063869c267aa3ca
-PKG_MIRROR_HASH:=d3e1094f27ba49a1f99045fb27724aaea51813260eaafebe255780336da57931
+PKG_SOURCE_DATE:=2026-05-16
+PKG_SOURCE_VERSION:=733d3159e4c769a4fdd9e42ced53e346e2582beb
+PKG_MIRROR_HASH:=95c51a6b430f7b68e0b17d581fda7ac524d5e21e66375fdd4d4f830c61b2089a
include $(INCLUDE_DIR)/package.mk
# interfaces other than the one used for lan, if there are any.
final_wan_interfaces="$wan_network_interface $(echo $lan_interfaces | tr ' ' '\n' | grep -v "^$lan_network_interface$")"
-# If there are no suitable wan interfaces, exit with code 1.
-[ -z "$(echo "$final_wan_interfaces" | tr ' ' '\n')" ] && exit 1
+# Exit if there are no suitable wan interfaces.
+[ -z "$(echo "$final_wan_interfaces" | tr ' ' '\n')" ] && exit
# Delete existing wan and wan6 networks.
uci delete network.wan
# If firewall section for wan doesn't exist, create one.
else
fw_section=$(uci add firewall zone)
- uci set firewall.@rule[-1].name='wan'
- uci set firewall.@rule[-1].input='REJECT'
- uci set firewall.@rule[-1].output='ACCEPT'
- uci set firewall.@rule[-1].forward='DROP'
- uci set firewall.@rule[-1].masq='1'
- uci set firewall.@rule[-1].mtu_fix='1'
+ uci set firewall.@zone[-1].name='wan'
+ uci set firewall.@zone[-1].input='REJECT'
+ uci set firewall.@zone[-1].output='ACCEPT'
+ uci set firewall.@zone[-1].forward='DROP'
+ uci set firewall.@zone[-1].masq='1'
+ uci set firewall.@zone[-1].mtu_fix='1'
fi
index=1
uci set network.wan$index=interface
uci set network.wan$index.device="$dev"
uci set network.wan$index.proto='dhcp'
- uci set network.wan$index.peerdns='0'
uci set network.wan$index.metric="$index"
# Add every wan network entry to firewall wan zone.
index=$((index + 1))
done
-# Configure dnsmasq.
-# As we don't want to use the DNS servers advertised by WANs, set up DNS
-# forwarding. Use 8.8.8.8 and 8.8.4.4.
-uci -q del_list dhcp.@dnsmasq[0].server='8.8.8.8'
-uci -q del_list dhcp.@dnsmasq[0].server='8.8.4.4'
-uci add_list dhcp.@dnsmasq[0].server='8.8.8.8'
-uci add_list dhcp.@dnsmasq[0].server='8.8.4.4'
-
# Configure xray.
uci set xray.enabled.enabled='1'
# Commit changes.
uci commit
-# Enable bonding.
-bsbf-bonding --enable
+# Enable bonding and ignore the non-zero exit code of bsbf-bonding.
+bsbf-bonding --enable || true
--enable)
# Source /etc/bsbf/bsbf-bonding.conf. Exit if server_ipv4, server_port,
# or uuid is empty.
- . /etc/bsbf/bsbf-bonding.conf
+ [ -f /etc/bsbf/bsbf-bonding.conf ] && . /etc/bsbf/bsbf-bonding.conf
if [ -z "$server_ipv4" ] || [ -z "$server_port" ] || [ -z "$uuid" ]; then
- echo "server_ipv4, server_port, and uuid on /etc/bsbf/bsbf-bonding.conf must not be empty."
+ echo "server_ipv4, server_port, and uuid on /etc/bsbf/bsbf-bonding.conf must not be empty. Populate them and then run 'bsbf-bonding --enable'." >&2
exit 1
fi