check-wget.sh 203 B

1234567891011
  1. #!/bin/bash
  2. set -xe
  3. FNAME="$1"
  4. URL="$2"
  5. SHA512="$3"
  6. SHAFILE="${FNAME}.sha512"
  7. wget -O "${FNAME}" "${URL}"
  8. trap "rm -f ${SHAFILE}" EXIT
  9. echo "${SHA512} ${FNAME}" > "${SHAFILE}"
  10. sha512sum -c "${SHAFILE}"