download-bridge-data.sh 619 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. # Populate array of months we care about
  3. months=()
  4. # 2020
  5. for i in {7..12}; do
  6. months+=( 2020-$(printf %02d $i) )
  7. done
  8. # 2021
  9. for i in {1..4}; do
  10. months+=( 2021-$(printf %02d $i) )
  11. done
  12. # Download the archives if we don't have them already
  13. for i in ${months[@]}; do
  14. if [ ! -f data/bridge-extra-infos-${i}.tar.xz ]; then
  15. curl -Lo data/bridge-extra-infos-${i}.tar.xz https://collector.torproject.org/archive/bridge-descriptors/extra-infos/bridge-extra-infos-${i}.tar.xz || exit 1
  16. fi
  17. done
  18. # Check that we have the right archives
  19. sha256sum -c data/bridge-extra-infos.sha256 || exit 1