Use if [[ condition ]]; then ... fi for decisions. Test files with -f (is a file) and -d (is a directory). Compare numbers with -gt, -lt, -eq. Use && and || for chained logic in one-liners.
if/else in Bash
#!/bin/bash
FILE="/etc/nginx/nginx.conf"
if [ -f "$FILE" ]; then
echo "Config exists"
elif [ -d "/etc/nginx" ]; then
echo "Directory exists, no config"
else
echo "Nginx not found"
fi
# String comparison
if [ "$1" == "start" ]; then
systemctl start nginx
fi
# Number comparison
if [ $COUNT -gt 10 ]; then
echo "Too many"
fi