From 8abd528bb3e23704028b49353d614a8affea3f8d Mon Sep 17 00:00:00 2001 From: Nils Date: Sun, 6 Nov 2016 19:45:28 +0100 Subject: add mp4 files to gallery --- gallery.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'gallery.sh') diff --git a/gallery.sh b/gallery.sh index b655339..7e66605 100755 --- a/gallery.sh +++ b/gallery.sh @@ -201,8 +201,8 @@ done fi -### Movies (MOV) -if [[ $(ls -l | grep -i mov | wc -l) -gt 0 ]]; then +### Movies (MOV or MP4) +if [[ $(ls -l | grep -i "mov\|mp4" | wc -l) -gt 0 ]]; then cat >> "$htmlfile" << EOF
@@ -212,12 +212,22 @@ if [[ $(ls -l | grep -i mov | wc -l) -gt 0 ]]; then
EOF + if [[ $(ls -l | grep -i "mov" | wc -l) -gt 0 ]]; then for filename in *.[mM][oO][vV]; do - filesize=$(ls -lah $filename | awk '{ print $5}') + filesize=$(ls -lah "$filename" | awk '{ print $5}') cat >> "$htmlfile" << EOF $movieicon $filename ($filesize) EOF done + fi + if [[ $(ls -l | grep -i "mp4" | wc -l) -gt 0 ]]; then + for filename in *.[mM][pP]4; do + filesize=$(ls -lah "$filename" | awk '{ print $5}') + cat >> "$htmlfile" << EOF +$movieicon $filename ($filesize) +EOF + done + fi echo '
' >> "$htmlfile" fi @@ -233,7 +243,7 @@ if [[ $(ls -l | grep -i zip | wc -l) -gt 0 ]]; then
EOF for filename in *.[zZ][iI][pP]; do - filesize=$(ls -lah $filename | awk '{ print $5}') + filesize=$(ls -lah "$filename" | awk '{ print $5}') cat >> "$htmlfile" << EOF $downloadicon $filename ($filesize) EOF -- cgit v1.2.3