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
2010187fde
commit
89e0fc20eb
1 changed files with 4 additions and 5 deletions
|
|
@ -226,7 +226,7 @@ download_xray() {
|
||||||
tmp="$(mktemp -d)"; trap '[[ -n "${tmp:-}" ]] && rm -rf "$tmp"' RETURN
|
tmp="$(mktemp -d)"; trap '[[ -n "${tmp:-}" ]] && rm -rf "$tmp"' RETURN
|
||||||
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 -Dm755 "$tmp/xray" "$outdir/xray"
|
install -m 755 "$tmp/xray" "$outdir/xray"
|
||||||
}
|
}
|
||||||
|
|
||||||
download_singbox() {
|
download_singbox() {
|
||||||
|
|
@ -249,7 +249,7 @@ download_singbox() {
|
||||||
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"; return 1; }
|
||||||
install -Dm755 "$bin" "$outdir/sing-box"
|
install -m 755 "$bin" "$outdir/sing-box"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Move geo files to outroot/bin
|
# Move geo files to outroot/bin
|
||||||
|
|
@ -486,7 +486,7 @@ cp -a * %{buildroot}/opt/v2rayN/
|
||||||
|
|
||||||
# Launcher (prefer native ELF first, then DLL fallback)
|
# Launcher (prefer native ELF first, then DLL fallback)
|
||||||
install -dm0755 %{buildroot}%{_bindir}
|
install -dm0755 %{buildroot}%{_bindir}
|
||||||
cat > %{buildroot}%{_bindir}/v2rayn << 'EOF'
|
install -m0755 /dev/stdin %{buildroot}%{_bindir}/v2rayn << 'EOF'
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
DIR="/opt/v2rayN"
|
DIR="/opt/v2rayN"
|
||||||
|
|
@ -503,11 +503,10 @@ echo "v2rayN launcher: no executable found in $DIR" >&2
|
||||||
ls -l "$DIR" >&2 || true
|
ls -l "$DIR" >&2 || true
|
||||||
exit 1
|
exit 1
|
||||||
EOF
|
EOF
|
||||||
chmod 0755 %{buildroot}%{_bindir}/v2rayn
|
|
||||||
|
|
||||||
# Desktop file
|
# Desktop file
|
||||||
install -dm0755 %{buildroot}%{_datadir}/applications
|
install -dm0755 %{buildroot}%{_datadir}/applications
|
||||||
cat > %{buildroot}%{_datadir}/applications/v2rayn.desktop << 'EOF'
|
install -m0644 /dev/stdin %{buildroot}%{_datadir}/applications/v2rayn.desktop << 'EOF'
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=v2rayN
|
Name=v2rayN
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue