Skip to content

Instantly share code, notes, and snippets.

@joemaffia
Created February 4, 2015 13:26
Show Gist options
  • Save joemaffia/87f8328eed1810a93260 to your computer and use it in GitHub Desktop.
Save joemaffia/87f8328eed1810a93260 to your computer and use it in GitHub Desktop.

Revisions

  1. Joe Maffia created this gist Feb 4, 2015.
    14 changes: 14 additions & 0 deletions aem-import-json.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/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"