Created
March 12, 2014 02:34
-
-
Save mjordan/9499708 to your computer and use it in GitHub Desktop.
Archivematica REST transer API test
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/sh | |
source_directory=$1 | |
transfer_directory='/var/archivematica/sharedDirectory/watchedDirectories/activeTransfers/standardTransfer' | |
cp -rp $source_directory $transfer_directory | |
if [ $? -eq 0 ]; then | |
echo "Files in $source_directory copied to $transfer_directory, firing API call." | |
message=(curl --data="username=rick&api_key=74e506e5a206c99a95c8c514300fd27fec939f69&type=standard&directory=$transfer_directory" http://127.0.0.1/api/transfer/approve) | |
if [ $? -ne 0 ]; then | |
echo "curl could not complete the AIP call." | |
exit(1) | |
fi | |
else | |
echo "Problem copying files, exiting." | |
exit(1) | |
fi | |
echo "API call successful: $message" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment