To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 62796a33 authored by Reto Da Forno's avatar Reto Da Forno

shell tool updated

parent aedd55af
......@@ -2,7 +2,7 @@
#
# ------------------------------
# Command line tool for FlockLab
# v1.3
# v1.4
#
# Usage:
#
......@@ -14,6 +14,7 @@
# -f <testid>: fetch via webdav
# -o <platform>: get a list of the currently available (online) observers
# -p: get a list of the available platforms
# -i <testid>: get test info (title, desc, status, start time etc.)
# -h: display help
#
# For the commands -g and -f, the download directory can be specified as an additional argument.
......@@ -28,11 +29,11 @@
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'
SERVER_URL=https://flocklab.ethz.ch/user
CURL_PARAMS='-sS -4 --insecure'
FLAUTH_FILE=.flocklabauth
NETRC_FILE=$HOME/.netrc
DAV_URL=https://www.flocklab.ethz.ch/user/webdav
DAV_URL=${SERVER_URL}/webdav
DAV_CLIENT=cadaver
if [ -f $FLAUTH_FILE ]
......@@ -55,10 +56,16 @@ then
done < "$NETRC_FILE"
fi
if [ -z "$USER" ] || [ -z "$PASSWORD" ]
then
echo "No username or password found. Add your credentials to ~/.flocklabauth."
exit 1
fi
usage()
{
cat << EOF
command line tool for FlockLab (https://flocklab.ethz.ch)
command line tool for FlockLab (${SERVER_URL})
usage: $0 [OPTION]
......@@ -71,6 +78,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
-i <testid>: get test info (title, desc, status, start time etc.)
-h: display this help page
EOF
}
......@@ -141,7 +149,7 @@ then
exit 1
fi
while getopts “v:c:a:d:f:g:o:ph” OPTION
while getopts “v:c:a:d:f:g:o:pi:h” OPTION
do
case $OPTION in
v)
......@@ -296,6 +304,13 @@ do
echo $RESPONSE
fi
;;
i)
RESPONSE=`curl $CURL_PARAMS -o - -F username="$USER" -F password="$PASSWORD" -F q="testinfo" -F id=$OPTARG $SERVER_URL/api.php`
if [ $? -eq 0 ]
then
echo $RESPONSE
fi
;;
h)
usage
exit 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment