Check if a directory exists in a shell script - From http://stackoverflow.com/questions/59838/check-if-a-directory-exists-in-a-shell-script
if [ -d "$DIRECTORY" ]; then # Control will enter here if $DIRECTORY exists. fi