From d038f5e8492c5be614248d3443faa0c2c39b499d Mon Sep 17 00:00:00 2001 From: yige Date: Thu, 22 Aug 2019 22:05:54 +0800 Subject: [PATCH] fix bug --- README.md | 19 ++++++------------- setup.sh | 5 +++-- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b9a6cb7..44e3145 100644 --- a/README.md +++ b/README.md @@ -2,23 +2,16 @@ ## Guide -### Linux、FreeBSD、Darwin(Mac OS) - -```shell -source <(curl -sL https://git.io/fj8OJ) - -``` +### Linux、Darwin(Mac OS) To **install** or **run** dc-agent, you can use the [install script][2] using cURL: ```sh -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash -``` - -or Wget: - -```sh -wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash +curl -O https://y-bi.top/setup.sh && sudo chmod +x setup.sh && ./setup.sh +# Or +# wget https://y-bi.top/setup.sh +# sudo chmod +x setup.sh +# sudo ./setup.sh ``` ### Windows diff --git a/setup.sh b/setup.sh index fb71fdf..62729f1 100755 --- a/setup.sh +++ b/setup.sh @@ -27,7 +27,7 @@ arch() { ;; "x86") out="386" ;; - *) out=res + *) out=$res ;; esac @@ -66,6 +66,7 @@ download() { getLatestVersion() { local platformValue=`platform` + local archValue=`arch` if [[ platformValue == "no" ]]; then echo -e "\nThis operating system is not supported.\n" @@ -75,7 +76,7 @@ getLatestVersion() { exit 10 fi - local res=$(download -s https://server-0.sercretcore.cn/api/download\?arch=`arch`\&platform=`platform`) + local res=$(download -s https://server-0.sercretcore.cn/api/download\?arch=${archValue}\&platform=${platformValue}) local status=$(echo "${res}" | grepCross '"status":.' | sed 's/"status"://g') if [[ "${status}" == "1" ]]; then