소스 검색

Merge pull request #419 from pete1019/patch-6

check if files exists, if not get from latest
Alex 3 년 전
부모
커밋
b9673da846
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      scripts/netclient-install.sh

+ 8 - 1
scripts/netclient-install.sh

@@ -93,7 +93,14 @@ esac
 
 echo "Binary = $dist"
 
-wget -nv -O netclient https://github.com/gravitl/netmaker/releases/download/$VERSION/$dist
+url="https://github.com/gravitl/netmaker/releases/download/$VERSION/$dist"
+if curl --output /dev/null --silent --head --fail "$url"; then
+	echo "Downloading $dist $VERSION"
+	wget -nv -O netclient $url
+else
+	echo "Downloading $dist latest"
+	wget -nv -O netclient https://github.com/gravitl/netmaker/releases/download/latest/$dist
+fi
 chmod +x netclient
 sudo ./netclient join -t $KEY
 rm -f netclient