#!/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