#!/bin/bash
#
#  Drop Bacula database -- works for whatever is configured,
#    MySQL, SQLite, PostgreSQL
#

RETVAL=0

. /etc/sysconfig/bacula

case "$BACULA_BACKEND" in
    postgresql)
        echo "Dropping PostgreSQL database"
        /usr/share/bacula/drop_postgresql_database $*
        ;;
    sqlite)
        echo "Dropping SQLite database"
        /usr/share/bacula/drop_sqlite_database $*
        ;;
    sqlite3)
        echo "Dropping SQLite3 database"
        /usr/share/bacula/drop_sqlite3_database $*
        ;;
    mysql)
        echo "Dropping MySQL database"
        /usr/share/bacula/drop_mysql_database $*
        ;;
    *)
        echo "Unknown database type"
        $RETVAL=1
        ;;
esac

exit $RETVAL
