I'm not sure why exactly, but jan on IRC advised against trying to use Erlang for this even though it may be possible. Using ExternalProcesses sounds like the way to go. I was hoping to avoid external dependencies and extra configuration for clients but I guess it will be easier to manage security issues with this approach.
Thanks a lot! Cillian