@@ -190,8 +190,8 @@ function get_updater_url() {
190
190
echo "This operation system ${UNAME} is not supported by updater."
191
191
exit 1
192
192
fi
193
- UPDATER_FILENAME="install_master_ ${OS} - ${ARCH} .tar.gz"
194
- UPDATER_URL="https://github.com/algorand/go-algorand-doc/raw/master/downloads/installers/ ${OS} _ ${ARCH} / ${UPDATER_FILENAME} "
193
+ UPDATER_FILENAME="install_stable_ ${OS} - ${ARCH} _ 3 . 6 . 2 .tar.gz"
194
+ UPDATER_URL="https://github.com/algorand/go-algorand/releases/download/v 3 . 6 . 2 -stable/install_stable_ ${OS} - ${ARCH} _ 3 . 6 . 2 .tar.gz "
195
195
}
196
196
197
197
# check to see if the binary updater exists. if not, it will automatically the correct updater binary for the current platform
@@ -214,35 +214,34 @@ function check_for_updater() {
214
214
exit 1
215
215
fi
216
216
217
- # intitialize temporary directory for updater
218
- local updater_tempdir ="" \
219
- updater_archive=" ${updater_tempdir} / ${UPDATER_FILENAME} "
217
+ # create temporary directory for updater archive
218
+ local UPDATER_TEMPDIR =""
219
+ UPDATER_TEMPDIR="$(mktemp -d 2 >/dev/null || mktemp -d -t "tmp") "
220
220
221
- # create temporary directory for updater archive
222
- updater_tempdir=$(mktemp -d 2 >/dev/null || mktemp -d -t "tmp")
221
+ local UPDATER_ARCHIVE="${UPDATER_TEMPDIR} / ${UPDATER_FILENAME} "
223
222
224
- CURL_OUT=$(curl -sSL ${UPDATER_URL} - o "$updater_archive ")
223
+ CURL_OUT=$(curl -sSL ${UPDATER_URL} - o "$UPDATER_ARCHIVE ")
225
224
if [ "$? " != "0 " ]; then
226
225
echo "failed to download updater binary from ${UPDATER_URL} using curl."
227
226
echo "${CURL_OUT} "
228
227
exit 1
229
228
fi
230
229
231
- if [ ! -f "${updater_archive } " ]; then
232
- echo "downloaded file ${updater_archive } is missing."
230
+ if [ ! -f "${UPDATER_ARCHIVE } " ]; then
231
+ echo "downloaded file ${UPDATER_ARCHIVE } is missing."
233
232
exit
234
233
fi
235
234
236
- # extract and install updater
237
- tar -zxf "$updater_archive " -C "$updater_tempdir " updater
238
- mv "${updater_tempdir } / updater" "${SCRIPTPATH} "
235
+ # extract and install updater
236
+ tar -zxf "$UPDATER_ARCHIVE " -C "$UPDATER_TEMPDIR " updater
237
+ mv "${UPDATER_TEMPDIR } / updater" "${SCRIPTPATH} "
239
238
if [ "$? " != "0 " ]; then
240
- echo "failed to extract updater binary from ${updater_archive } "
239
+ echo "failed to extract updater binary from ${UPDATER_ARCHIVE } "
241
240
exit 1
242
241
fi
243
242
244
243
# clean up temp directory
245
- rm -rf "$updater_tempdir "
244
+ rm -rf "$UPDATER_TEMPDIR "
246
245
echo "updater binary was installed at ${SCRIPTPATH} / updater"
247
246
}
248
247
0 commit comments