From 7413c94ea223b5d3d2f2d34974e301d803d2abc9 Mon Sep 17 00:00:00 2001 From: iamwwc Date: Sun, 8 Sep 2019 10:11:09 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=202.=20=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- install.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 33a84cb..3b5cc58 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ - aufs作为底层文件系统与镜像的实现 ### 如何安装 -`bash <(curl -s https://raw.githubusercontent.com/iamwwc/wwcdocker/master/install.sh)` +`source <(curl -s -L https://raw.githubusercontent.com/iamwwc/wwcdocker/master/install.sh)` ### 开发 默认在 `dev` 分支开发,开发完成,测试通过之后会发布至 `master` 分支,并构建 `release` diff --git a/install.sh b/install.sh index db06ade..43859be 100644 --- a/install.sh +++ b/install.sh @@ -4,13 +4,21 @@ # https://raw.githubusercontent.com/iamwwc/wwcdocker/master/install.sh # TO INSTALL this script, run following -# bash <(curl -s https://raw.githubusercontent.com/iamwwc/wwcdocker/master/install.sh) +# source <(curl -s -L https://raw.githubusercontent.com/iamwwc/wwcdocker/master/install.sh) red='\033[0;31m' plain='\033[0m' [[ $EUID -ne 0 ]] && echo -e "[${red}Error${plain}] This script must be run as root!" && exit 1 +beforepath=$(pwd) + +tempdir="/tmp/wwcdockertempdir${RANDOM}" + +mkdir $tempdir -p + +cd $tempdir + # download wwcdocker binary curl -s https://api.github.com/repos/iamwwc/wwcdocker/releases/latest \ | grep browser_download_url \ @@ -22,5 +30,7 @@ chmod u+x wwcdocker #export to path export PATH=$PATH:${cwd} +cd $beforepath + green='\033[0;32m' echo -e "${green}Type wwcdocker for help :)${plain}"