# For the commands -g and -f, the download directory can be specified as an additional argument.
#
# Your FlockLab login credentials need to be stored in .flocklabauth in your home directory as follows:
# USER=[your_username]
# PASSWORD=[your_password]
...
...
@@ -23,9 +25,9 @@
# If you want to be able to download your test results via webdav (-f), you need to install the client 'cadaver'.
# ------------------------------
DEST=/tmp # destination directory
EXTRACT=1 # extract results?
TESTCONFIG=0 # also download XML test config?
DEST=${3:-/tmp/flocklab}# destination directory (if not specified, the default is used: /tmp/flocklab)
EXTRACT=1 # extract results?
TESTCONFIG=0 # also download XML test config?
SERVER_URL=https://www.flocklab.ethz.ch/user
CURL_PARAMS='-sS -4'
FLAUTH_FILE=.flocklabauth
...
...
@@ -69,6 +71,7 @@ OPTIONS:
-f <testid>: fetch test results (via webdav)
-o <platform>: get a list of currently available observers
-p: get a list of available platforms
-h: display this help page
EOF
}
...
...
@@ -231,6 +234,10 @@ do
;;
g)
echo"Fetching results for test $OPTARG ..."
if[!-d$DEST]
then
mkdir$DEST
fi
OUTFILE=$DEST/$OPTARG.tar.gz
RESPONSE=`curl $CURL_PARAMS-X POST -H"Content-Type: application/x-www-form-urlencoded"-d"testid=${OPTARG}&query=get&username=${USER}&password=${PASSWORD}"-o$OUTFILE$SERVER_URL/result_download_archive.php`