From 8316582269cebf3c551b40c457e75ba569ffe4c6 Mon Sep 17 00:00:00 2001 From: Ceda EI <19731116+Ceda-EI@users.noreply.github.com> Date: Mon, 2 Apr 2018 01:52:18 +0530 Subject: [PATCH] Fix downloader.sh. Added another curl to get the URL of the image. --- downloader.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/downloader.sh b/downloader.sh index d2db181..da97d8e 100755 --- a/downloader.sh +++ b/downloader.sh @@ -18,7 +18,10 @@ if ! json=$(curl -s $url); then fi # Get image location from json -image_url=$(echo $json | jq -r ".links.download_location") +image_download_url=$(echo $json | jq -r ".links.download_location") +image_download_url="$image_download_url?client_id=$key" +image_url=$(curl -s $image_download_url | jq -r .url) +if [[ $? -ne 0 ]] ; then exit 1; fi # Download image and check if curl fails curl $image_url > ~/.rand_bg