From d14f26a8cb3e63e596ecfb7f52d17c46cd5b5da2 Mon Sep 17 00:00:00 2001 From: remittor Date: Thu, 25 Dec 2025 14:54:49 +0300 Subject: [PATCH] updater: Fix find base package after ZIP unpack --- zapret/update-pkg.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/zapret/update-pkg.sh b/zapret/update-pkg.sh index d189341..834beb8 100755 --- a/zapret/update-pkg.sh +++ b/zapret/update-pkg.sh @@ -383,15 +383,19 @@ if [ "$opt_update" != "" ]; then echo "------ Downloaded packages:" echo "$ZAP_PKG_LIST" echo "------" - ZAP_PKG_BASE_FN=$( find "$ZAP_PKG_DIR" -maxdepth 1 -type f -name "zapret2_*.${ZAP_PKG_EXT}" | head -n 1 ) - ZAP_PKG_LUCI_FN=$( find "$ZAP_PKG_DIR" -maxdepth 1 -type f -name "luci-app-*.${ZAP_PKG_EXT}" | head -n 1 ) + if [ "$PKG_MGR" != "apk" ]; then + ZAP_PKG_BASE_FN=$( find "$ZAP_PKG_DIR" -maxdepth 1 -type f -name "zapret2_*.${ZAP_PKG_EXT}" | head -n 1 ) + else + ZAP_PKG_BASE_FN=$( find "$ZAP_PKG_DIR" -maxdepth 1 -type f -name "zapret2-[0-9]*.?*.${ZAP_PKG_EXT}" | head -n 1 ) + fi + ZAP_PKG_LUCI_FN=$( find "$ZAP_PKG_DIR" -maxdepth 1 -type f -name "luci-app-zapret2*.${ZAP_PKG_EXT}" | head -n 1 ) if [ ! -f "$ZAP_PKG_BASE_FN" ]; then - echo "ERROR: File \"zapret2_*.${ZAP_PKG_EXT}\" not found!" + echo "ERROR: File \"zapret2*.${ZAP_PKG_EXT}\" not found!" return 231 fi echo "ZAP_PKG_BASE_FN = $ZAP_PKG_BASE_FN" if [ ! -f "$ZAP_PKG_LUCI_FN" ]; then - echo "ERROR: File \"luci-app-*.${ZAP_PKG_EXT}\" not found!" + echo "ERROR: File \"luci-app-zapret2*.${ZAP_PKG_EXT}\" not found!" return 232 fi echo "ZAP_PKG_LUCI_FN = $ZAP_PKG_LUCI_FN"