mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 12:35:46 +00:00
Update package-rhel.sh
This commit is contained in:
parent
0ca3282d89
commit
c1055d317b
1 changed files with 5 additions and 3 deletions
|
|
@ -223,10 +223,11 @@ download_xray() {
|
||||||
url="https://github.com/XTLS/Xray-core/releases/download/v${ver}/Xray-linux-64.zip"
|
url="https://github.com/XTLS/Xray-core/releases/download/v${ver}/Xray-linux-64.zip"
|
||||||
fi
|
fi
|
||||||
echo "[+] Download xray: $url"
|
echo "[+] Download xray: $url"
|
||||||
tmp="$(mktemp -d)"; trap '[[ -n "${tmp:-}" ]] && rm -rf "$tmp"' RETURN
|
tmp="$(mktemp -d)"
|
||||||
curl -fL "$url" -o "$tmp/$zipname"
|
curl -fL "$url" -o "$tmp/$zipname"
|
||||||
unzip -q "$tmp/$zipname" -d "$tmp"
|
unzip -q "$tmp/$zipname" -d "$tmp"
|
||||||
install -m 755 "$tmp/xray" "$outdir/xray"
|
install -m 755 "$tmp/xray" "$outdir/xray"
|
||||||
|
rm -rf "$tmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
download_singbox() {
|
download_singbox() {
|
||||||
|
|
@ -244,12 +245,13 @@ download_singbox() {
|
||||||
url="https://github.com/SagerNet/sing-box/releases/download/v${ver}/sing-box-${ver}-linux-amd64.tar.gz"
|
url="https://github.com/SagerNet/sing-box/releases/download/v${ver}/sing-box-${ver}-linux-amd64.tar.gz"
|
||||||
fi
|
fi
|
||||||
echo "[+] Download sing-box: $url"
|
echo "[+] Download sing-box: $url"
|
||||||
tmp="$(mktemp -d)"; trap '[[ -n "${tmp:-}" ]] && rm -rf "$tmp"' RETURN
|
tmp="$(mktemp -d)"
|
||||||
curl -fL "$url" -o "$tmp/$tarname"
|
curl -fL "$url" -o "$tmp/$tarname"
|
||||||
tar -C "$tmp" -xzf "$tmp/$tarname"
|
tar -C "$tmp" -xzf "$tmp/$tarname"
|
||||||
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"; 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"
|
||||||
|
rm -rf "$tmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Move geo files to outroot/bin
|
# Move geo files to outroot/bin
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue