From 5719c46b2dc10183c058146f0c5ff0e2405dd912 Mon Sep 17 00:00:00 2001 From: "antoine.leveugle" Date: Thu, 9 Jun 2016 20:53:21 +0200 Subject: [PATCH] feat: make the execution path relative --- ovh-api-bash-client.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ovh-api-bash-client.sh b/ovh-api-bash-client.sh index 1ac496d..f493d53 100755 --- a/ovh-api-bash-client.sh +++ b/ovh-api-bash-client.sh @@ -18,7 +18,7 @@ API_URLS[EU]="https://api.ovh.com/1.0" declare -A API_CREATE_APP_URLS API_CREATE_APP_URLS[CA]="https://ca.api.ovh.com/createApp/" API_CREATE_APP_URLS[EU]="https://api.ovh.com/createApp/" -CURRENT_PATH="$(pwd)" +CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # THESE VARS WILL BE USED LATER @@ -191,7 +191,6 @@ request() { updateTime updateSignData "$METHOD" "$URL" "$POST_DATA" - RESPONSE=$(curl -s -w "\n%{http_code}\n" -X $METHOD --header 'Content-Type:application/json;charset=utf-8' --header "X-Ovh-Application:$OVH_APP_KEY" --header "X-Ovh-Timestamp:$TIME" --header "X-Ovh-Signature:$SIG" --header "X-Ovh-Consumer:$OVH_CONSUMER_KEY" --data "$POST_DATA" ${API_URLS[$TARGET]}$URL) RESPONSE_STATUS=$(echo "$RESPONSE" | sed -n '$p') RESPONSE_CONTENT=$(echo "$RESPONSE" | sed '$d')