Alpine: Move global variable to main function to fix runtime error after refactoring

pull/86/head
Meo597 2025-04-12 00:58:37 +08:00
parent 2e14edba2e
commit fc8c3ed1c6
1 changed files with 5 additions and 4 deletions

View File

@ -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