#!/bin/bash # Where is the PDF database echo -n "Where is the PDF database? " read location # Add the named PDF to the online collection if [ "%$2%" != "%--force%" ] then gv "$1" echo -n "Publish? (y/n) " read publish if [ "%$publish%" != "%y%" ] then echo "Not publishing" exit fi fi echo "Adding $1" highest=`cat $location/highest` objid=$(( $highest + 1 )) pobjid=`printf "%06d" $objid` echo "New object id is $objid ($pobjid)" echo "Moving PDF" mkdir -p $location/$pobjid cp "$1" $location/$pobjid/data.pdf echo "Processing PDF" ./processpdf $location $pobjid touch /home/httpd/html/pdfdb/$pobjid/data.pandalex touch /home/httpd/html/pdfdb/$pobjid/data.openpdf echo $objid > /home/httpd/html/pdfdb/highest