X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fmaloo_upload.sh;h=e16b45a21568c32415c9d1952d91cdc5e674daba;hp=dc81ed0051cccb1b8947fb7affdbf416e919e09c;hb=e7d2df16545709874a880a92388ddc6817ef5684;hpb=1cbea4f4c650bcba8ab73e01ea069229f7e33362 diff --git a/lustre/tests/maloo_upload.sh b/lustre/tests/maloo_upload.sh index dc81ed0..e16b45a 100755 --- a/lustre/tests/maloo_upload.sh +++ b/lustre/tests/maloo_upload.sh @@ -1,31 +1,39 @@ #!/bin/sh +set -e + FILENAME=$1 if [ -r ~/.maloorc ] ; then - source ~/.maloorc + source ~/.maloorc else - echo "Error: ~/.maloorc not found. Please obtain this file from the maloo web interface, under 'Upload results'" - exit 1 + echo "Error: ~/.maloorc not found." \ + "Please obtain this file from the maloo web interface," \ + "under 'Upload results'" + exit 1 fi if [ -z $FILENAME ] ; then - echo "Usage: ${0} " - exit 2 + echo "Usage: ${0} " + exit 2 fi - if [ ! -r $FILENAME ] ; then - echo "Input file '$FILENAME' not found" - exit 3 + echo "Input file '$FILENAME' not found" + exit 3 fi echo Uploading $FILENAME to $MALOO_URL if [ -d $FILENAME ] ; then pushd $FILENAME - tar czf - * | curl -F "user_id=${MALOO_USER_ID}" -F "upload=@-" -F "user_upload_token=${MALOO_UPLOAD_TOKEN}" ${MALOO_URL} > /dev/null + tar czf upload.tar.gz * | + curl -F "user_id=${MALOO_USER_ID}" -F "upload=@upload.tar.gz" \ + -F "user_upload_token=${MALOO_UPLOAD_TOKEN}" ${MALOO_URL} \ + > /dev/null popd else - curl -F "user_id=${MALOO_USER_ID}" -F "upload=@${FILENAME}" -F "user_upload_token=${MALOO_UPLOAD_TOKEN}" ${MALOO_URL} > /dev/null + curl -F "user_id=${MALOO_USER_ID}" -F "upload=@${FILENAME}" \ + -F "user_upload_token=${MALOO_UPLOAD_TOKEN}" ${MALOO_URL} \ + > /dev/null fi echo Complete.