COOPR-568: changes for distributed mode

What if you're running `setup.sh` from a checkout, which is the use case I wrote this script to resolve?