From bb5de23743b46864ba6992ed130b2d2452df72db Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Thu, 11 Apr 2024 16:21:28 +0000 Subject: pbr: update to 1.1.4-r15 * delete obsolete files/etc/init.d/pbr.init * add files/etc/uci-defaults/91-pbr-iptables to help update from older OpenWrt * add files/etc/uci-defaults/91-pbr-nft to help update from older OpenWrt * update files/etc/uci-defaults/91-pbr-netifd to only add tables to supported ifaces * re-organize variants in the Makefile so that they hopefull work this time * update prerm for all variants for better user experience * update the -netifd prerm to remove leftofver entries from network and rt_tables file In the init script: * add decorations for netifd-interfaces related operations (blue ticks) * add rtTablesFile variables instead of hard-coding the rt_tables file * add function to check if the table is netifd-derived * add error messages/hints for failed interface setup and failed WAN discovery * make cleanup_rt_tables the netifd-compatible * streamline interface_process function with a clearer case statement * rename the interface_process `pre-init` option to `pre_init` to conform to the other functions options naming style Signed-off-by: Stan Grishin --- net/pbr/files/etc/uci-defaults/91-pbr-nft | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 net/pbr/files/etc/uci-defaults/91-pbr-nft (limited to 'net/pbr/files/etc/uci-defaults/91-pbr-nft') diff --git a/net/pbr/files/etc/uci-defaults/91-pbr-nft b/net/pbr/files/etc/uci-defaults/91-pbr-nft new file mode 100644 index 000000000..0406e2a43 --- /dev/null +++ b/net/pbr/files/etc/uci-defaults/91-pbr-nft @@ -0,0 +1,30 @@ +#!/bin/sh +# shellcheck disable=SC2015,SC3037,SC3043 + +readonly pbrFunctionsFile='/etc/init.d/pbr' +if [ -s "$pbrFunctionsFile" ]; then +# shellcheck source=../../etc/init.d/pbr + . "$pbrFunctionsFile" +else + printf "%b: pbr init.d file (%s) not found! \n" '\033[0;31mERROR\033[0m' "$pbrFunctionsFile" +fi + +# Transition resolver_set depending on dnsmasq support +if [ "$(uci_get pbr config resolver_set)" != 'dnsmasq.nftset' ]; then + if check_dnsmasq_nftset; then + output "Setting resolver_set to 'dnsmasq.nftset'... " + uci_set pbr config resolver_set 'dnsmasq.nftset' && output_okn || output_failn + elif check_agh_ipset; then + output "Setting resolver_set to 'adguardhome.ipset'... " + uci_set pbr config resolver_set 'adguardhome.ipset' && output_okn || output_failn + elif check_dnsmasq_ipset; then + output "Setting resolver_set to 'dnsmasq.ipset'... " + uci_set pbr config resolver_set 'dnsmasq.ipset' && output_okn || output_failn + else + output "Setting resolver_set to 'none'... " + uci_set pbr config resolver_set 'none' && output_okn || output_failn + fi + uci_commit pbr +fi + +exit 0 -- cgit v1.2.3