run.sh 998 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # Check that dependencies are installed before going further
  3. if [ -z "$(command -v curl)" ]; then
  4. echo "This script needs curl to be installed."
  5. exit 1
  6. fi
  7. if [ -z "$(command -v python3)" ]; then
  8. echo "This script needs python3 to be installed."
  9. exit 1
  10. fi
  11. ./scripts/check-python-deps.py
  12. if [ "$?" != 0 ]; then
  13. echo "This script needs numpy to be installed."
  14. exit 1
  15. fi
  16. # Get bridge data
  17. if [ "$1" == "--fast" ]; then
  18. echo "Extracting some pre-processed data..."
  19. cd data && tar xf bridge_data.tar.gz && cd ..
  20. else
  21. echo "Downloading and processing data from step 1..."
  22. echo "This will take quite a long time (around 12.5 hours on my device)"
  23. echo "and require a few GB of free space while running."
  24. ./scripts/get-bridge-data.sh
  25. fi
  26. # Get list of email-distributed bridges
  27. ./scripts/get-email-bridges.sh
  28. # Clean up bridge data for the format we want
  29. ./scripts/clean-bridge-data.sh
  30. # Evaluate blockages and get stats
  31. ./scripts/get-stats.sh