routeros_firmware: Give error if checksum fetch fails

This commit is contained in:
Timo Makinen 2024-03-30 13:55:20 +00:00
parent 604ae20554
commit 50f02e85ac

View file

@ -31,6 +31,10 @@ fi
checksum="$(curl -sSf "https://mikrotik.com/download" | \
sed -n 's/.*routeros-[0-9\.]*-arm\.npk<\/td>.*<td>SHA256<\/td><td>\(.*\)<\/td>.*/\1/p')"
if [ -z "$checksum" ]; then
echo "ERR: Failed to determine package checksum" 1>&2
exit 1
fi
echo "Downloading new package '${packagename}'"
trap 'rm -f -- "${packagename}.tmp"' EXIT