refactor: rewrite use bash to sh (#1)

This commit is contained in:
D 2026-02-01 18:32:15 +03:00 committed by GitHub
parent 6bc321c032
commit 1bb7ce5a11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
# Download Xray latest
@ -15,7 +15,7 @@ fi
check_if_running_as_root() {
# If you want to run as another user, please modify $EUID to be owned by this user
if [[ "$EUID" -ne '0' ]]; then
if [[ "$(id -u)" -ne '0' ]]; then
echo "error: You must run this script as root!"
exit 1
fi
@ -86,7 +86,7 @@ download_xray() {
else
DOWNLOAD_LINK="https://github.com/$UPSTREAM_REPO/Xray-core/releases/download/$RELEASE_TAG/Xray-linux-$ARCH.zip"
fi
echo "Downloading Xray archive: $DOWNLOAD_LINK"
if ! curl -RL -H 'Cache-Control: no-cache' -o "$ZIP_FILE" "$DOWNLOAD_LINK"; then
echo 'error: Download failed! Please check your network or try again.'