title: Perfectly working curl command fails when executed in a groovy script
body: <p>I have a post commit hook (a groovy script) in gitblit to invoke a REST endpoint. In this script I am executing a curl command. But it seems to fail. The curl command works fine when executed from the commandline.</p>
  
  <p>Following is my groovy script.</p>
  
  <pre><code>#!/usr/bin/env groovy
  
  
  def repoUrl= "https://gitblit.myhost.com/git/" + repository + ".git"
  json='{"repository":{"url":"'+repoUrl+'"}}'
  
  def response = "curl -v -k -X POST -H \"Content-Type: application/json\" -d '${json}' https://username:password@anotherhost.com:9443/restendpoint".execute().text
  println response 
  </code></pre>
  
  <p>repository is passed by gitblit to this script and I have verified it.</p>
  
  <p>Can somebody help me with this.</p>