Обновить install.sh

This commit is contained in:
yanistyle
2026-10-11 23:15:58 +03:00
parent 1376cd991d
commit 38ef5c7b33
+7 -65
View File
@@ -64,59 +64,6 @@ pkg_install() {
fi
}
# Установка podkop без подтягивания sing-box из репозитория OpenWrt
# (podkop зависит от sing-box, поэтому обычная установка скачает стоковый).
# Остальные зависимости ставятся отдельно через pkg_install_feed.
pkg_install_nodeps() {
local pkg_file="$1"
if [ "$PKG_IS_APK" -eq 1 ]; then
# apk не умеет пропускать зависимости: создаём пустой пакет-заглушку
# sing-box, чтобы зависимость podkop считалась выполненной
apk_stub_singbox
apk add --allow-untrusted "$pkg_file"
else
opkg install --nodeps "$pkg_file"
fi
}
# apk: пустой пакет "sing-box" (без файлов), чтобы apk не скачивал стоковый
# sing-box из репозитория. Сам бинарник ставится отдельным скриптом.
# Если создать заглушку не удалось, будет установлен стоковый sing-box.
apk_stub_singbox() {
if apk list --installed 2>/dev/null | grep -q "^sing-box-[0-9]"; then
return 0
fi
local stub_dir="/tmp/sing-box-stub"
rm -rf "$stub_dir"
mkdir -p "$stub_dir/root"
if apk mkpkg \
-I name:sing-box \
-I version:1.14.0-r0 \
-I arch:noarch \
-I "description:Stub package, sing-box is installed manually" \
-F "$stub_dir/root" \
-o "$stub_dir/sing-box-stub.apk" >/dev/null 2>&1 \
&& apk add --allow-untrusted "$stub_dir/sing-box-stub.apk"; then
msg "Created sing-box stub package (stock sing-box will not be installed)"
else
msg "Could not create sing-box stub: stock sing-box will be installed as a dependency"
fi
rm -rf "$stub_dir"
}
# Установка пакетов из репозитория OpenWrt по имени
pkg_install_feed() {
if [ "$PKG_IS_APK" -eq 1 ]; then
apk add "$@"
else
opkg install "$@"
fi
}
update_config() {
printf "\033[48;5;196m\033[1m╔══════════════════════════════════════════════════════════════════════╗\033[0m\n"
printf "\033[48;5;196m\033[1m║ ! Обнаружена старая версия podkop. ║\033[0m\n"
@@ -157,6 +104,13 @@ update_config() {
}
ask_sing_box() {
if pkg_is_installed "^sing-box"; then
msg "sing-box уже установлен, будет проверена версия и обновлён при необходимости"
msg "(sing-box is already installed, version will be checked and updated if needed)"
INSTALL_SINGBOX=1
return
fi
msg "Установить sing-box? y/n (Install sing-box?)"
while true; do
read -r -p '' SINGBOX_ANSWER
@@ -252,14 +206,6 @@ main() {
exit 1
fi
# Если sing-box ставить не нужно (opkg): ставим зависимости podkop из
# репозитория OpenWrt вручную, а сам podkop - с --nodeps, чтобы opkg
# не скачивал стоковый sing-box как зависимость
if [ "$INSTALL_SINGBOX" -eq 0 ] && [ "$PKG_IS_APK" -eq 0 ]; then
msg "Installing podkop dependencies (without sing-box)..."
pkg_install_feed curl jq kmod-nft-tproxy coreutils-base64 bind-dig
fi
# Install podkop and luci-app-podkop
for pkg in podkop luci-app-podkop; do
file=""
@@ -271,11 +217,7 @@ main() {
done
if [ -n "$file" ]; then
msg "Installing $file..."
if [ "$INSTALL_SINGBOX" -eq 0 ]; then
pkg_install_nodeps "$DOWNLOAD_DIR/$file"
else
pkg_install "$DOWNLOAD_DIR/$file"
fi
sleep 3
fi
done