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"