url = https://website.com/download/media/123
This would maybe return a file called file.zip or maybe not. So I want to check if the file which gets downloaded ends with .zip
Maybe something like this?
wget $url -P ~/downloads
if [ downloaded file ends with .zip ]
then:
unzip file.zip
else
echo "Downloaded file doesn't end with zip!"
fi