#!/bin/bash

#
# Need to cleanup postgresql db for docconversion.
#
DROPUSER="/usr/bin/dropuser -q -U postgres"
  DROPDB="/usr/bin/dropdb -q -U postgres"

 CONNECT="/usr/bin/psql -d clearinghouse -U postgres -q"
		 
if  [  -f /usr/bin/dropdb  ]; then

	cd $SCRIPT_DIRECTORY
		
	$CONNECT --file drop.psql 
	${DROPUSER} pronir
	${DROPDB} clearinghouse
	message  "${MESSAGE_COLOR}DocConversion database has been removed."
	message  "${DEFAULT_COLOR}"

else
	
	message  "${PROBLEM_COLOR}Dropdb unavailable, remove DocConveriosn database failed."
	message  "${DEFAULT_COLOR}"
	return 1
	
fi

#
# Maybe the user would like to keep Postgresql installed?
#
#if query "Would you like to keep Postgresql spell installed?" "y" 
#then
#	message  "${MESSAGE_COLOR}Keeping Postgresql."
#	message  "${DEFAULT_COLOR}"
#	return 0
#else
#	message  "${DISPEL_COLOR}Dispelling Postgresql as requested."
#	message  "${DEFAULT_COLOR}"
#	dispel postgresql
#fi
