From 237369faf91f50cfe634053f6249bedb5c21d7fa Mon Sep 17 00:00:00 2001 From: Manuel Rego Casasnovas Date: Fri, 2 Nov 2012 16:57:22 +0100 Subject: [PATCH] Fix parameters order in import example rest scripts Included dependency with cURL in the web services documentation. FEA: ItEr77S04BugFixing --- scripts/rest-clients/README | 5 ++++- scripts/rest-clients/import.sh | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/scripts/rest-clients/README b/scripts/rest-clients/README index d8823e972..1e0f34831 100644 --- a/scripts/rest-clients/README +++ b/scripts/rest-clients/README @@ -57,7 +57,10 @@ Requirements ------------ These scripts are written in bash so you need to be running a bash terminal to -use them. +use them. And they use cURL to do the HTTP requests, you can install it with the +following command in Debian based distributions:: + + # apt-get install curl Moreover, it is recommended to have Tidy available in your system. You can install it with the following command in Debian based distributions:: diff --git a/scripts/rest-clients/import.sh b/scripts/rest-clients/import.sh index 856b2b44a..629fc9b64 100755 --- a/scripts/rest-clients/import.sh +++ b/scripts/rest-clients/import.sh @@ -7,19 +7,21 @@ read loginName printf "Password: " read password -if [ "$3" = "--prod" ]; then +file=$2 + +if [ "$2" = "--prod" ]; then baseServiceURL=$PRODUCTION_BASE_SERVICE_URL certificate=$PRODUCTION_CERTIFICATE -elif [ "$3" = "--dev" ]; then - baseServiceURL=$DEVELOPMENT_BASE_SERVICE_URL - certificate=$DEVELOPMENT_CERTIFICATE + file=$3 +elif [ "$2" = "--dev" ]; then + baseServiceURL=$DEVELOPMENT_BASE_SERVICE_URL + certificate=$DEVELOPMENT_CERTIFICATE + file=$3 else - baseServiceURL=$DEMO_BASE_SERVICE_URL - certificate=$DEMO_CERTIFICATE + baseServiceURL=$DEMO_BASE_SERVICE_URL + certificate=$DEMO_CERTIFICATE fi -file=$2 - if [ "$file" = "" ]; then printf "Missing file\n" 1>&2 exit 1