Skip to content
Snippets Groups Projects
Commit 2979e655 authored by Jonathan Seguin's avatar Jonathan Seguin
Browse files

Add url parameter

parent a3d92d59
No related branches found
No related tags found
No related merge requests found
......@@ -2,12 +2,7 @@
action=$1
arg2=$2
BASE_URL=http://binfo06.iric.ca:8000
LOGIN_URL=${BASE_URL}/login
FILE_UPLOAD_URL=${BASE_URL}/secure/servlet/datafiles/upload
COOKIES=.iricdata.cookies.txt
CURL_BIN="curl -c $COOKIES -b $COOKIES -e $LOGIN_URL"
BASE_URL=https://data.iric.ca
help() {
echo "To download files in a dataset, provide \"get\" as first argument, followed by a dataset ID."
......@@ -19,6 +14,9 @@ help() {
echo ""
echo "To avoid being prompted for your username and password combination. Place your username on the first line "
echo "and password on the 2nd line of a file named .auth alongside this script."
echo ""
echo "The service url defaults to $BASE_URL. This may be overriden with the --url parameter."
echo "ex. ./iric-data.sh get 321 --url http://binfo06.iric.ca:8000"
}
login() {
......@@ -50,7 +48,7 @@ if [ -z "$action" ]; then
exit
fi
LONG=annotation:,lab:,dataset:,as-user:,help
LONG=annotation:,lab:,dataset:,as-user:,url:,help
OPTS=$(getopt --long $LONG --name "$0" -- "$@")
if [ $? != 0 ] ; then exit 1 ; fi
eval set -- "$OPTS"
......@@ -73,6 +71,10 @@ while true ; do
AS_USER="$2"
shift 2
;;
--url )
BASE_URL="$2"
shift 2
;;
--help )
help
exit
......@@ -88,6 +90,11 @@ while true ; do
esac
done
LOGIN_URL=${BASE_URL}/login
FILE_UPLOAD_URL=${BASE_URL}/secure/servlet/datafiles/upload
COOKIES=.iricdata.cookies.txt
CURL_BIN="curl -c $COOKIES -b $COOKIES -e $LOGIN_URL"
case "$action" in
"get")
dataset_id=$arg2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment