]> Pileus Git - ~andy/ct/commitdiff
Update mkgallery script
authorAndy Spencer <andy753421@gmail.com>
Wed, 14 Aug 2013 05:44:00 +0000 (05:44 +0000)
committerAndy Spencer <andy753421@gmail.com>
Wed, 14 Aug 2013 05:44:00 +0000 (05:44 +0000)
gallery/mkgallery

index 60b8c7590a046611b3f42df741018e63a7fc4b68..78d0b09686a5c08a9f580e9d18523884bd74b1d1 100755 (executable)
@@ -1,10 +1,20 @@
 #!/bin/bash
 
-mkdir -p large small thumb
-mv "$@" large
+if [ -z "$1" ]; then
+       echo "usage: mkgallery <path>"
+       exit
+fi
 
-chgrp apache small thumb
-chmod 775    small thumb
+SRC=/home/andy/src/ct/gallery
 
-ln -s ~/git/ct/gallery/gallery  index.bin
-ln -s ~/git/ct/gallery/htaccess .htaccess
+base="$1"
+files=("$base"/*)
+
+mkdir -p "$base"/{large,small,thumb}
+mv       "${files[@]}" large
+
+chgrp apache "$base"/{small,thumb}
+chmod 775    "$base"/{small,thumb}
+
+ln -s $SRC/gallery  "$base"/index.bin
+ln -s $SRC/htaccess "$base"/.htaccess