Extend `remsh` to read cookie from various sources

We can set cookies using `./dev/run --erlang-cookie=crumbles` or
`vm.args`: `-setcookie crumbles`.

If neither of them is set or we set the cookie in both places, then
the Erlang node will read the cookie from `~/.erlang.cookie`.

Add this mechanism to the `remsh` script to extend flexibility.

Related PR: https://github.com/apache/couchdb/pull/5531
1 file changed