Check if a file or directory exists with bash

Tagged nginx, daemon, bash, linux, debian  Languages bash

This script tests if nginx exists and is executable. The script prints a warning and exits, if nginx doesn't exists or isn't executable:

if [ ! -x $DAEMON ]
   echo "Couldn't find $DAEMON. Please set path to DAEMON."
   exit 0

See man test for more information on how to use the test command.