Fix downloader.sh.

Added another curl to get the URL of the image.
This commit is contained in:
Ceda EI 2018-04-02 01:52:18 +05:30
parent d6bcb8f531
commit 8316582269
1 changed files with 4 additions and 1 deletions

View File

@ -18,7 +18,10 @@ if ! json=$(curl -s $url); then
fi fi
# Get image location from json # 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 # Download image and check if curl fails
curl $image_url > ~/.rand_bg curl $image_url > ~/.rand_bg