Created
February 4, 2015 13:26
-
-
Save joemaffia/87f8328eed1810a93260 to your computer and use it in GitHub Desktop.
Import json to JCR via bash
This file contains 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 | |
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