I need to check to see if a file exists in a web directory. if the file does exist, I would like to execute a bash script. If it doesn't, exit and don't execute the bash script.
Here's what I have so far (in a bash script):
url="http://website.url/directory/file.txt"
if wget --spider ${url} 2>/dev/null; then
bash some_bash_script.sh
else
exit 0
fi