Skip to content

Instantly share code, notes, and snippets.

@vincent99
Created May 1, 2015 04:19
Show Gist options
  • Save vincent99/2086b67834e5d3b744c3 to your computer and use it in GitHub Desktop.
Save vincent99/2086b67834e5d3b744c3 to your computer and use it in GitHub Desktop.
Set api.host setting
#!/bin/bash
project="?projectId=user"
host="1.2.3.4:8080"
url="http://${host}/v1/settings/api.host${project}"
orig=$(curl -s $url)
new=$(jq ". + {value: \"${newvalue}\"}" <<< "$orig")
link=$(jq -r ".links.self" <<< "$orig")
curl -X PUT -H 'Content-Type: application/json' -d "${host}" "${link}${project}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment