Добавил fallback на случай если не хватает зависимостей через opkg

This commit is contained in:
2026-05-15 13:48:14 +03:00
parent c6883c3031
commit 5464fb3424
+16 -4
View File
@@ -57,10 +57,22 @@ else
echo "Downloading: ${SINGBOX_IPK_URL}" echo "Downloading: ${SINGBOX_IPK_URL}"
if wget -O "$SINGBOX_IPK_TMP" "$SINGBOX_IPK_URL"; then if wget -O "$SINGBOX_IPK_TMP" "$SINGBOX_IPK_URL"; then
opkg install --force-reinstall "$SINGBOX_IPK_TMP" if opkg install --force-reinstall "$SINGBOX_IPK_TMP"; then
rm -f "$SINGBOX_IPK_TMP" echo "sing-box installed from direct ipk."
SINGBOX_UPGRADED=1 rm -f "$SINGBOX_IPK_TMP"
echo "sing-box installed from direct ipk." SINGBOX_UPGRADED=1
else
echo "opkg install failed (dependency issue?). Extracting binary manually..."
tar -xzf "$SINGBOX_IPK_TMP" -C /tmp
tar -xzf /tmp/data.tar.gz -C /tmp
if cp /tmp/usr/bin/sing-box /usr/bin/sing-box && chmod +x /usr/bin/sing-box; then
SINGBOX_UPGRADED=1
echo "sing-box installed successfully from manual binary extraction."
else
echo "ERROR: Failed to copy sing-box binary."
fi
rm -rf /tmp/usr /tmp/data.tar.gz /tmp/debian-binary "$SINGBOX_IPK_TMP"
fi
else else
echo "ERROR: Failed to download sing-box ipk. Manual installation may be required." echo "ERROR: Failed to download sing-box ipk. Manual installation may be required."
fi fi