updated shell script to work with multi-database; still working on bridge mail