@@ -32,29 +32,6 @@ happyexit() {
3232 exit 0
3333}
3434
35- validate_checksum () {
36- filename=$1
37- SHA=$( curl --proto ' =https' --tlsv1.2 -sSfL " ${url} .sha256" )
38- echo " "
39- echo " Validating checksum..."
40-
41- case $checksumbin in
42- * openssl)
43- checksum=$( $checksumbin dgst -sha256 " ${filename} " | sed -e ' s/^.* //' )
44- ;;
45- * shasum)
46- checksum=$( $checksumbin -a256 " ${filename} " | sed -e ' s/ .*$//' )
47- ;;
48- esac
49-
50- if [ " $checksum " != " $SHA " ]; then
51- echo " Checksum validation failed." >&2
52- return 1
53- fi
54- echo " Checksum valid."
55- return 0
56- }
57-
5835OS=$( uname -s)
5936arch=$( uname -m)
6037cli_arch=" "
@@ -106,12 +83,6 @@ case $OS in
10683esac
10784OS=$( echo " $OS " | tr ' [:upper:]' ' [:lower:]' )
10885
109- checksumbin=$( command -v openssl) || checksumbin=$( command -v shasum) || {
110- echo " Failed to find checksum binary. Please install openssl or shasum."
111- exit 1
112- }
113-
114-
11586tmpdir=$( mktemp -d /tmp/linkerd2.XXXXXX)
11687srcfile=" linkerd2-cli-${LINKERD2_VERSION} -${OS} "
11788if [ -n " ${cli_arch} " ]; then
@@ -121,17 +92,15 @@ dstfile="${INSTALLROOT}/bin/linkerd-${LINKERD2_VERSION}"
12192url=" https://github.com/linkerd/linkerd2/releases/download/${LINKERD2_VERSION} /${srcfile} "
12293
12394if [ -e " ${dstfile} " ]; then
124- if validate_checksum " ${dstfile} " ; then
125- echo " "
126- echo " Linkerd ${LINKERD2_VERSION} was already downloaded; making it the default 🎉"
127- echo " "
128- echo " To force re-downloading, delete '${dstfile} ' then run me again."
129- (
130- rm -f " ${INSTALLROOT} /bin/linkerd"
131- ln -s " ${dstfile} " " ${INSTALLROOT} /bin/linkerd"
132- )
133- happyexit
134- fi
95+ echo " "
96+ echo " Linkerd ${LINKERD2_VERSION} was already downloaded; making it the default 🎉"
97+ echo " "
98+ echo " To force re-downloading, delete '${dstfile} ' then run me again."
99+ (
100+ rm -f " ${INSTALLROOT} /bin/linkerd"
101+ ln -s " ${dstfile} " " ${INSTALLROOT} /bin/linkerd"
102+ )
103+ happyexit
135104fi
136105
137106(
140109 echo " Downloading ${srcfile} ..."
141110 curl --proto ' =https' --tlsv1.2 -fLO " ${url} "
142111 echo " Download complete!"
143-
144- if ! validate_checksum " ${srcfile} " ; then
145- exit 1
146- fi
147112 echo " "
148113)
149114
0 commit comments