gen-configs.sh 509 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. # Generate the configuration files for an experiment we're about to do
  3. exp_num="$1"
  4. secrecy="$2"
  5. harshness="$3"
  6. prob="$4"
  7. uuid="$5"
  8. mkdir -p "configs/${uuid}"
  9. f1="configs/${uuid}/troll_patrol_config.json"
  10. cp "${f1}.template" "${f1}"
  11. f2="configs/${uuid}/simulation_config.json"
  12. cp "${f2}.template" "${f2}"
  13. # Troll Patrol config
  14. sed -i "s/HARSHNESS/$harshness/" "${f1}"
  15. # Lox Simulation config
  16. sed -i "s/CENSOR_SECRECY/\"$secrecy\"/" "${f2}"
  17. sed -i "s/PROB_USER_SUBMITS_REPORTS/$prob/" "${f2}"