common 414 B

12345678910111213141516171819202122
  1. PREBUILT_DATA_DIR=data
  2. checksum() {
  3. local file="$1"
  4. local sum="$2"
  5. echo "$file: verifying checksum..."
  6. echo "$sum $file" | sha256sum -c
  7. }
  8. get_file() {
  9. local url="$1"
  10. local file="$2"
  11. local sum="$3"
  12. if [[ -f "$file" ]]
  13. then
  14. echo "$file: found"
  15. else
  16. echo "$file: not found, downloading..."
  17. wget "$url" -O "$file"
  18. fi
  19. checksum "$file" "$sum"
  20. }