Error handling
This commit is contained in:
parent
1cc157df21
commit
24b821d74b
1 changed files with 4 additions and 4 deletions
|
@ -4,15 +4,15 @@ set -eu
|
|||
FILE="$IMG/boot.img"
|
||||
rm -f "$FILE"
|
||||
|
||||
echo "Downloading $BOOT..."
|
||||
echo "Downloading ${BOOT}..."
|
||||
|
||||
# Check if running with interactive TTY or redirected to docker log
|
||||
if [ -t 1 ]; then
|
||||
wget "$BOOT" -O "$FILE".tmp -q --no-check-certificate --show-progress
|
||||
wget "${BOOT}" -O "$FILE".tmp -q --no-check-certificate --show-progress
|
||||
else
|
||||
wget "$BOOT" -O "$FILE".tmp -q --no-check-certificate --show-progress --progress=dot:giga
|
||||
wget "${BOOT}" -O "$FILE".tmp -q --no-check-certificate --show-progress --progress=dot:giga
|
||||
fi
|
||||
|
||||
[ ! -f "$FILE".tmp ] && echo "Download failed" && exit 61
|
||||
[ ! -f "$FILE".tmp ] && echo "Failed to download ${BOOT}" && exit 61
|
||||
|
||||
mv -f "$FILE".tmp "$FILE"
|
||||
|
|
Loading…
Reference in a new issue