Whamcloud - gitweb
LU-3097 build: fix 'no effect' errors
[fs/lustre-release.git] / lustre / tests / maloo_upload.sh
1 #!/bin/sh
2
3 FILENAME=$1
4
5 if [ -r ~/.maloorc ] ; then
6         source ~/.maloorc
7 else
8         echo "Error: ~/.maloorc not found.  Please obtain this file from the maloo web interface, under 'Upload results'"
9         exit 1
10 fi
11
12 if [ -z $FILENAME ] ; then
13         echo "Usage: ${0} <tarball or directory>"
14         exit 2
15 fi
16
17
18 if [ ! -r $FILENAME ] ; then
19         echo "Input file '$FILENAME' not found"
20         exit 3
21 fi
22
23 echo Uploading $FILENAME to $MALOO_URL
24 if [ -d $FILENAME ] ; then
25         pushd $FILENAME
26         tar czf - * | curl -F "user_id=${MALOO_USER_ID}" -F "upload=@-" -F "user_upload_token=${MALOO_UPLOAD_TOKEN}" ${MALOO_URL} > /dev/null
27         popd
28 else
29         curl -F "user_id=${MALOO_USER_ID}" -F "upload=@${FILENAME}" -F "user_upload_token=${MALOO_UPLOAD_TOKEN}" ${MALOO_URL} > /dev/null
30 fi
31 echo Complete.