From fc8c3ed1c6f3fa9d4feefe4557699d45d9d684a9 Mon Sep 17 00:00:00 2001 From: Meo597 <197331664+Meo597@users.noreply.github.com> Date: Sat, 12 Apr 2025 00:58:37 +0800 Subject: [PATCH] Alpine: Move global variable to main function to fix runtime error after refactoring --- alpinelinux/install-release.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/alpinelinux/install-release.sh b/alpinelinux/install-release.sh index 9c12d39..044e75d 100644 --- a/alpinelinux/install-release.sh +++ b/alpinelinux/install-release.sh @@ -3,10 +3,6 @@ set -euxo pipefail -TMP_DIRECTORY="$(mktemp -d)/" -ZIP_FILE="${TMP_DIRECTORY}Xray-linux-$MACHINE.zip" -DOWNLOAD_LINK="https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-$MACHINE.zip" - check_alpine() { if [ -f /etc/alpine-release ]; then return 0 @@ -214,6 +210,11 @@ main() { check_if_running_as_root || return 1 identify_architecture || return 1 install_software + + TMP_DIRECTORY="$(mktemp -d)/" + ZIP_FILE="${TMP_DIRECTORY}Xray-linux-$MACHINE.zip" + DOWNLOAD_LINK="https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-$MACHINE.zip" + download_xray verification_xray decompression