How can I test a directory to see if it contains files typically used for a website? I've searched and found how to test for one extension at a time, which led me to do this:
c1=`ls -1 /var/www/*.htm 2>/dev/null | wc -l` c2=`ls -1 /var/www/*.html 2>/dev/null | wc -l` c3=`ls -1 /var/www/*.php 2>/dev/null | wc -l` if [ $c1 != 0 ] || [ $c2 != 0 ] || [ $c3 != 0 ]; then echo true fi
However, this does not strike me as being particularly efficient, as obviously there are a great many different file types that could be used for a website. Is there a
case statement I could utilize instead?