From fbe83028cc9be61d605a2a3951019f50e62e4dd1 Mon Sep 17 00:00:00 2001 From: xiaorouji <60100640+xiaorouji@users.noreply.github.com> Date: Sun, 23 Apr 2023 16:36:46 +0800 Subject: [PATCH] luci: make nftables better compat --- luci-app-passwall/Makefile | 2 +- luci-app-passwall/root/etc/uci-defaults/luci-passwall | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index b664b0e64..6038b8a80 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall -PKG_VERSION:=4.65-1 +PKG_VERSION:=4.65-2 PKG_RELEASE:= PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/root/etc/uci-defaults/luci-passwall b/luci-app-passwall/root/etc/uci-defaults/luci-passwall index cc39c00a2..340003d4e 100755 --- a/luci-app-passwall/root/etc/uci-defaults/luci-passwall +++ b/luci-app-passwall/root/etc/uci-defaults/luci-passwall @@ -29,6 +29,15 @@ EOF [ ! -s "/etc/config/passwall" ] && cp -f /usr/share/passwall/0_default_config /etc/config/passwall touch /etc/config/passwall_show >/dev/null 2>&1 + +[ "$(opkg list-installed | grep "firewall4")" ] && [ "$(opkg list-installed | grep "nftables")" ] && { + [ "$(opkg list-installed | grep "kmod\-nft\-socket")" ] && [ "$(opkg list-installed | grep "kmod\-nft\-tproxy")" ] && [ "$(opkg list-installed | grep "kmod\-nft\-nat")" ] && { + uci -q set passwall.@global_forwarding[0].use_nft=1 + uci -q commit passwall + sed -i "s#use_nft '0'#use_nft '1'#g" /usr/share/passwall/0_default_config + } +} + rm -f /tmp/luci-indexcache rm -rf /tmp/luci-modulecache/ killall -HUP rpcd 2>/dev/null