Добавил fallback на случай если не хватает зависимостей через opkg
This commit is contained in:
+16
-4
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user