Created
May 1, 2015 04:19
-
-
Save vincent99/2086b67834e5d3b744c3 to your computer and use it in GitHub Desktop.
Set api.host setting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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