mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-23 14:52:43 +00:00
Update docker-cron-runner/xray-tools.sh
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
ba07e15695
commit
20ca19233a
1 changed files with 19 additions and 2 deletions
|
|
@ -122,11 +122,28 @@ install_xray_core() {
|
||||||
cd "$XRAYDIR"
|
cd "$XRAYDIR"
|
||||||
|
|
||||||
wget -q "https://github.com/XTLS/Xray-core/releases/download/${XRAY_VERSION}/Xray-linux-${ARCH}.zip"
|
wget -q "https://github.com/XTLS/Xray-core/releases/download/${XRAY_VERSION}/Xray-linux-${ARCH}.zip"
|
||||||
unzip "Xray-linux-${ARCH}.zip" -d ./xray-unzip
|
|
||||||
|
# Validate the downloaded zip file
|
||||||
|
if [ ! -f "Xray-linux-${ARCH}.zip" ] || [ ! -s "Xray-linux-${ARCH}.zip" ]; then
|
||||||
|
echo "[ERR] Failed to download Xray-core zip or file is empty"
|
||||||
|
cd "$OLD_DIR"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
unzip -q "Xray-linux-${ARCH}.zip" -d ./xray-unzip
|
||||||
|
|
||||||
|
# Validate the extracted xray binary
|
||||||
|
if [ ! -f "./xray-unzip/xray" ] || [ ! -s "./xray-unzip/xray" ]; then
|
||||||
|
echo "[ERR] Failed to extract xray binary"
|
||||||
|
rm -rf ./xray-unzip
|
||||||
|
rm -f "Xray-linux-${ARCH}.zip"
|
||||||
|
cd "$OLD_DIR"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
cp ./xray-unzip/xray ./"xray-linux-${FNAME}"
|
cp ./xray-unzip/xray ./"xray-linux-${FNAME}"
|
||||||
rm -r xray-unzip
|
rm -r xray-unzip
|
||||||
rm "Xray-linux-${ARCH}.zip"
|
rm "Xray-linux-${ARCH}.zip"
|
||||||
}
|
|
||||||
|
|
||||||
if [ "${0##*/}" = "xray-tools.sh" ]; then
|
if [ "${0##*/}" = "xray-tools.sh" ]; then
|
||||||
cmd="$1"
|
cmd="$1"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue