From dd1b0330ea79c44b8e4b02167979074829ec9ccf Mon Sep 17 00:00:00 2001 From: Dct Mei Date: Mon, 13 Apr 2020 00:41:50 +0800 Subject: [PATCH] Fix mistakes --- install-release.sh | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/install-release.sh b/install-release.sh index d94367f..67160f4 100644 --- a/install-release.sh +++ b/install-release.sh @@ -1,24 +1,23 @@ #!/bin/ash +# Identify architecture +case "$(arch -s)" in + 'i386' | 'i686') + BIT='32' + ;; + 'amd64' | 'x86_64') + BIT='64' + ;; + *) + echo "error: The architecture is not supported." + exit 1 + ;; +esac + TMP_DIRECTORY="$(mktemp -d)/" ZIP_FILE="${TMP_DIRECTORY}v2ray-linux-$BIT.zip" DOWNLOAD_LINK="https://github.com/v2ray/v2ray-core/releases/latest/download/v2ray-linux-$BIT.zip" -identify_architecture() { - case "$(arch -s)" in - 'i386' | 'i686') - BIT='32' - ;; - 'amd64' | 'x86_64') - BIT='64' - ;; - *) - echo "error: The architecture is not supported." - exit 1 - ;; - esac -} - install_software() { if [[ -n "$(command -v curl)" ]]; then return @@ -148,7 +147,6 @@ information() { } main() { - identify_architecture install_software install_software download_v2ray