From a7f56b4070fe86af011e56397efb26ccebc4e867 Mon Sep 17 00:00:00 2001 From: Liangbin Lian Date: Sun, 9 Jun 2024 01:35:22 +0800 Subject: [PATCH] luci: fix app.sh check_depends fail on installing (#3252) fixed https://github.com/xiaorouji/openwrt-passwall/issues/3251 --- luci-app-passwall/root/usr/share/passwall/app.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index 9b6319de54..1d7f5e2c04 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -204,14 +204,15 @@ check_port_exists() { } check_depends() { + local depends local tables=${1} if [ "$tables" == "iptables" ]; then for depends in "iptables-mod-tproxy" "iptables-mod-socket" "iptables-mod-iprange" "iptables-mod-conntrack-extra" "kmod-ipt-nat"; do - [ -z "$(opkg status ${depends} 2>/dev/null | grep 'Status' | awk -F ': ' '{print $2}' 2>/dev/null)" ] && echolog "$tables透明代理基础依赖 $depends 未安装..." + [ -s "/usr/lib/opkg/info/${depends}.control" ] || echolog "$tables透明代理基础依赖 $depends 未安装..." done else for depends in "kmod-nft-socket" "kmod-nft-tproxy" "kmod-nft-nat"; do - [ -z "$(opkg status ${depends} 2>/dev/null | grep 'Status' | awk -F ': ' '{print $2}' 2>/dev/null)" ] && echolog "$tables透明代理基础依赖 $depends 未安装..." + [ -s "/usr/lib/opkg/info/${depends}.control" ] || echolog "$tables透明代理基础依赖 $depends 未安装..." done fi }