Skip to content

Commit 1c182b1

Browse files
check md5 hash, correctly exit on failures.
Redirect output to stderr.
1 parent 4517e2e commit 1c182b1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

launcher

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ download_binary() {
3535
;;
3636
esac
3737

38-
curl -s -o ${package} -L https://get.discourse.org/launcher/latest/launcher-${os}-${arch}.tar.gz || (echo 'launcher download failed' >&2 && exit 1)
39-
curl -s -o ${package_md5} -L https://get.discourse.org/launcher/latest/launcher-${os}-${arch}.tar.gz.md5 || (echo 'launcher download failed' >&2 && exit 1)
38+
curl -s -o ${package} -L https://get.discourse.org/launcher/latest/launcher-${os}-${arch}.tar.gz || { echo 'launcher download failed' >&2 && exit 1; }
39+
curl -s -o ${package_md5} -L https://get.discourse.org/launcher/latest/launcher-${os}-${arch}.tar.gz.md5 || { echo 'launcher download failed' >&2 && exit 1; }
4040

41-
echo "$(cat ${package_md5}) ${package}" | md5sum --status -c || (echo 'checksum failed' >&2 && exit 1)
41+
echo "$(cat ${package_md5}) ${package}" | md5sum --status -c || { echo 'checksum failed' >&2 && exit 1; }
4242

4343
tar -zxf ${package} -C ${BINDIR}
4444
rm ${package} ${package_md5}
@@ -176,12 +176,13 @@ check_prereqs() {
176176
}
177177

178178
update() {
179-
rm ${BINDIR}/launcher
179+
rm ${BINDIR}/launcher 2>/dev/null
180180
download_binary
181181
}
182182

183183
case "$1" in
184184
update)
185+
echo "updating launcher..."
185186
update
186187
exit 0
187188
;;

0 commit comments

Comments
 (0)