mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-14 11:35:44 +00:00
fix (#9017)
* Update package-rhel.sh * Enhance download_singbox function to handle cronet
This commit is contained in:
parent
7329dbae11
commit
e19b000081
2 changed files with 13 additions and 4 deletions
|
|
@ -253,11 +253,14 @@ download_xray() {
|
||||||
}
|
}
|
||||||
|
|
||||||
download_singbox() {
|
download_singbox() {
|
||||||
local outdir="$1" rid="$2" ver="${SING_VER:-}" url tmp tarname="singbox.tar.gz" bin
|
# Download sing-box
|
||||||
|
local outdir="$1" rid="$2" ver="${SING_VER:-}" url tmp tarname="singbox.tar.gz" bin cronet
|
||||||
mkdir -p "$outdir"
|
mkdir -p "$outdir"
|
||||||
if [[ -z "$ver" ]]; then
|
if [[ -z "$ver" ]]; then
|
||||||
ver="$(curl -fsSL https://api.github.com/repos/SagerNet/sing-box/releases/latest \
|
ver="$(curl -fsSL https://api.github.com/repos/SagerNet/sing-box/releases/latest \
|
||||||
| grep -Eo '"tag_name":\s*"v[^"]+"' | sed -E 's/.*"v([^"]+)".*/\1/' | head -n1)" || true
|
| grep -Eo '"tag_name":\s*"v[^"]+"' \
|
||||||
|
| sed -E 's/.*"v([^"]+)".*/\1/' \
|
||||||
|
| head -n1)" || true
|
||||||
fi
|
fi
|
||||||
[[ -n "$ver" ]] || { echo "[sing-box] Failed to get version"; return 1; }
|
[[ -n "$ver" ]] || { echo "[sing-box] Failed to get version"; return 1; }
|
||||||
if [[ "$rid" == "linux-arm64" ]]; then
|
if [[ "$rid" == "linux-arm64" ]]; then
|
||||||
|
|
@ -272,6 +275,8 @@ download_singbox() {
|
||||||
bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)"
|
bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)"
|
||||||
[[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; rm -rf "$tmp"; return 1; }
|
[[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; rm -rf "$tmp"; return 1; }
|
||||||
install -m 755 "$bin" "$outdir/sing-box"
|
install -m 755 "$bin" "$outdir/sing-box"
|
||||||
|
cronet="$(find "$tmp" -type f -name 'libcronet*.so*' | head -n1 || true)"
|
||||||
|
[[ -n "$cronet" ]] && install -m 644 "$cronet" "$outdir/libcronet.so"
|
||||||
rm -rf "$tmp"
|
rm -rf "$tmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -232,11 +232,13 @@ download_xray() {
|
||||||
|
|
||||||
download_singbox() {
|
download_singbox() {
|
||||||
# Download sing-box
|
# Download sing-box
|
||||||
local outdir="$1" rid="$2" ver="${SING_VER:-}" url tmp tarname="singbox.tar.gz" bin
|
local outdir="$1" rid="$2" ver="${SING_VER:-}" url tmp tarname="singbox.tar.gz" bin cronet
|
||||||
mkdir -p "$outdir"
|
mkdir -p "$outdir"
|
||||||
if [[ -z "$ver" ]]; then
|
if [[ -z "$ver" ]]; then
|
||||||
ver="$(curl -fsSL https://api.github.com/repos/SagerNet/sing-box/releases/latest \
|
ver="$(curl -fsSL https://api.github.com/repos/SagerNet/sing-box/releases/latest \
|
||||||
| grep -Eo '"tag_name":\s*"v[^"]+"' | sed -E 's/.*"v([^"]+)".*/\1/' | head -n1)" || true
|
| grep -Eo '"tag_name":\s*"v[^"]+"' \
|
||||||
|
| sed -E 's/.*"v([^"]+)".*/\1/' \
|
||||||
|
| head -n1)" || true
|
||||||
fi
|
fi
|
||||||
[[ -n "$ver" ]] || { echo "[sing-box] Failed to get version"; return 1; }
|
[[ -n "$ver" ]] || { echo "[sing-box] Failed to get version"; return 1; }
|
||||||
if [[ "$rid" == "linux-arm64" ]]; then
|
if [[ "$rid" == "linux-arm64" ]]; then
|
||||||
|
|
@ -251,6 +253,8 @@ download_singbox() {
|
||||||
bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)"
|
bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)"
|
||||||
[[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; rm -rf "$tmp"; return 1; }
|
[[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; rm -rf "$tmp"; return 1; }
|
||||||
install -m 755 "$bin" "$outdir/sing-box"
|
install -m 755 "$bin" "$outdir/sing-box"
|
||||||
|
cronet="$(find "$tmp" -type f -name 'libcronet*.so*' | head -n1 || true)"
|
||||||
|
[[ -n "$cronet" ]] && install -m 644 "$cronet" "$outdir/libcronet.so"
|
||||||
rm -rf "$tmp"
|
rm -rf "$tmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue