File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ function get_extra_file {
6363 if [[ $file_url != file* ]]; then
6464 # If the file isn't cache, download it
6565 if [[ ! -f $FILES /$file_name ]]; then
66- wget --progress=dot:giga -c $file_url -O $FILES /$file_name
66+ wget --progress=dot:giga -t 2 - c $file_url -O $FILES /$file_name
6767 if [[ $? -ne 0 ]]; then
6868 die " $file_url could not be downloaded"
6969 fi
Original file line number Diff line number Diff line change @@ -98,8 +98,8 @@ function install_etcd3 {
9898 etcd_file=" $( get_extra_file $ETCD_DOWNLOAD_LOCATION ) "
9999 if [ ! -f " $FILES /etcd-$ETCD_VERSION -linux-$ETCD_ARCH /etcd" ]; then
100100 echo " ${ETCD_SHA256} $etcd_file " > $FILES /etcd.sha256sum
101- # NOTE(sdague ): this should go fatal if this fails
102- sha256sum -c $FILES /etcd.sha256sum
101+ # NOTE(yuanke wei ): rm the damaged file when checksum fails
102+ sha256sum -c $FILES /etcd.sha256sum || (sudo rm -f $etcd_file ; exit 1)
103103
104104 tar xzvf $etcd_file -C $FILES
105105 sudo cp $FILES /$ETCD_NAME /etcd $ETCD_BIN_DIR /etcd
You can’t perform that action at this time.
0 commit comments