run.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. fast=false
  17. sequential=false
  18. while [ -n "$1" ]; do
  19. if [ "$1" == "--fast" ]; then
  20. fast=true
  21. elif [ "$1" == "-s" ]; then
  22. sequential=true
  23. fi
  24. shift
  25. done
  26. # Get bridge data
  27. if [ "$fast" == "true" ]; then
  28. echo "Repacking some pre-processed data for the next step..."
  29. ./scripts/repack-preprocessed-data.sh
  30. else
  31. echo "Downloading data from the Tor Project..."
  32. ./scripts/download-bridge-data.sh
  33. if [ "$sequential" != "true" ]; then
  34. echo "Processing data from step 1 in 10 parallel steps..."
  35. echo "This will take a while (around an hour on my device)"
  36. echo "and require around 20 GB of free space while running."
  37. ./scripts/get-bridge-data.sh
  38. else
  39. echo "Processing data from step 1 sequentially..."
  40. echo "This will take quite a long time (around 12.5 hours on my device)"
  41. echo "and require a few GB of free space while running."
  42. ./scripts/get-bridge-data.sh -s
  43. fi
  44. fi
  45. # Get list of email-distributed bridges
  46. ./scripts/get-email-bridges.sh
  47. # Clean up bridge data for the format we want
  48. ./scripts/clean-bridge-data.sh
  49. # Evaluate blockages and get stats
  50. ./scripts/get-stats.sh