#!/bin/sh
#
# Gallery / List module
# Seung-young Kim <nobreak@kr.FreeBSD.org>
# 1999/04/17
#

month=`date +%h`
db="gallery.db"
dbback="gallery.$month.db"

if [ ! -f "$db" ]; then
	echo "File($db) not found!"
	exit 1
fi

sort "$db" > "$dbback"
cp "$dbback" "$db"

for category in "COMMERCIAL" "NON-PROFIT" "PERSONAL"; do
	grep -c "^${category}|" "$db" > "gallery.${category}.count"
	./gallery.sh "$category" > "gallery.${category}.html"
done

grep -c "|" "$db" > gallery.count

