that works, you could also just check if you can download http://remote.cvmfs.stratum0/cvmfs/foo.bar/.cvmfspublished, that way you only need curl or an equivalent tool and not cvmfs. For stratum ones there is also http://remote.cvmfs.stratum1/cvmfs/info/v1/repositories.json that gives you a list of replicated repositories.
Cheers,
Valentin