From 3a221f7bfd8c0d25dc2f7327aa9035bb71c6b479 Mon Sep 17 00:00:00 2001 From: Dct Mei Date: Sat, 11 Apr 2020 01:32:49 +0800 Subject: [PATCH] Fix the problem of unable to proxy download --- install-release.sh | 54 ++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/install-release.sh b/install-release.sh index ebfd058..83ada7a 100644 --- a/install-release.sh +++ b/install-release.sh @@ -154,33 +154,35 @@ if [[ "$#" -gt '0' ]]; then esac PROXY="-x $2" # Parameters available through a proxy server - case "$3" in - '--version') - if [[ "$#" -gt '4' ]] || [[ -z "$4" ]]; then - echo 'error: Please specify the correct version.' + if [[ "$#" -gt '2' ]]; then + case "$3" in + '--version') + if [[ "$#" -gt '4' ]] || [[ -z "$4" ]]; then + echo 'error: Please specify the correct version.' + exit 1 + fi + VERSION="$2" + ;; + '-c' | '--check') + if [[ "$#" -gt '3' ]]; then + echo 'error: Please enter the correct command.' + exit 1 + fi + CHECK='1' + ;; + '-f' | '--force') + if [[ "$#" -gt '3' ]]; then + echo 'error: Please enter the correct command.' + exit 1 + fi + FORCE='1' + ;; + *) + echo "$0: unknown option -- -" exit 1 - fi - VERSION="$2" - ;; - '-c' | '--check') - if [[ "$#" -gt '3' ]]; then - echo 'error: Please enter the correct command.' - exit 1 - fi - CHECK='1' - ;; - '-f' | '--force') - if [[ "$#" -gt '3' ]]; then - echo 'error: Please enter the correct command.' - exit 1 - fi - FORCE='1' - ;; - *) - echo "$0: unknown option -- -" - exit 1 - ;; - esac + ;; + esac + fi ;; *) echo "$0: unknown option -- -"