From 1f36fa7cc405e7e2af6946fe935b193694f6dca5 Mon Sep 17 00:00:00 2001 From: Nils Date: Sun, 6 Nov 2016 22:50:56 +0100 Subject: find maxdepth 1 Note: -maxdepth is not POSIX compliant option --- gallery.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gallery.sh b/gallery.sh index 2dfd560..505c653 100755 --- a/gallery.sh +++ b/gallery.sh @@ -202,7 +202,7 @@ done fi ### Movies (MOV or MP4) -if [[ $(find . -type f -name \*.mov -o -name '*.mp4' | wc -l) -gt 0 ]]; then +if [[ $(find . -type f -name \*.mov -o -name '*.mp4' -maxdepth 1 | wc -l) -gt 0 ]]; then cat >> "$htmlfile" << EOF
@@ -212,7 +212,7 @@ if [[ $(find . -type f -name \*.mov -o -name '*.mp4' | wc -l) -gt 0 ]]; then
EOF - if [[ $(find . -type f -name \*.mov | wc -l) -gt 0 ]]; then + if [[ $(find . -type f -name \*.mov -maxdepth 1 | wc -l) -gt 0 ]]; then for filename in *.[mM][oO][vV]; do filesize=$(wc -c < "$filename" | awk '{$1/=1000000;printf "%.2fMB\n",$1}') cat >> "$htmlfile" << EOF @@ -220,7 +220,7 @@ EOF EOF done fi - if [[ $(find . -type f -name \*.mp4 | wc -l) -gt 0 ]]; then + if [[ $(find . -type f -name \*.mp4 -maxdepth 1 | wc -l) -gt 0 ]]; then for filename in *.[mM][pP]4; do filesize=$(wc -c < "$filename" | awk '{$1/=1000000;printf "%.2fMB\n",$1}') cat >> "$htmlfile" << EOF @@ -232,7 +232,7 @@ EOF fi ### Downloads (ZIP) -if [[ $(find . -type f -name \*.zip | wc -l) -gt 0 ]]; then +if [[ $(find . -type f -name \*.zip -maxdepth 1 | wc -l) -gt 0 ]]; then cat >> "$htmlfile" << EOF
-- cgit v1.2.3