Skip to content

Instantly share code, notes, and snippets.

@joemaffia
Created February 4, 2015 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joemaffia/87f8328eed1810a93260 to your computer and use it in GitHub Desktop.
Save joemaffia/87f8328eed1810a93260 to your computer and use it in GitHub Desktop.
Import json to JCR via bash
#!/bin/bash
if (( $# < 1 ))
then
echo "You should add more stuff ;)"
echo "example: $0 ~/Desktop/file.json http://localhost:4502/content/copy"
exit 1
fi
j="$1"
url="$2"
cred="${3:-admin:admin}"
curl -u "$cred" -F":operation=import" -F":contentType=json" -F":replace=true" -F":replaceProperties=true" -F":contentFile=@$j" "$url"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment