]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/drop_bacula_database.in
Backport of class based catalog backends into Branch-5.1.
[bacula/bacula] / bacula / src / cats / drop_bacula_database.in
1 #!/bin/sh
2 #
3 #  Drop Bacula database -- works for whatever is configured,
4 #  MySQL, SQLite, PostgreSQL, Ingres
5 #
6
7 default_db_type=@DEFAULT_DB_TYPE@
8
9 #
10 # See if the first argument is a valid backend name.
11 # If so the user overrides the default database backend.
12 #
13 if [ $# -gt 0 ]; then
14    case $1 in
15      sqlite3)
16        db_type=$1
17        shift
18        ;;
19      mysql)
20        db_type=$1
21        shift
22        ;;
23      postgresql)
24        db_type=$1
25        shift
26        ;;
27      ingres)
28        db_type=$1
29        shift
30        ;;
31      *)
32        ;;
33    esac
34 fi
35
36 #
37 # If no new db_type is gives use the default db_type.
38 #
39 if [ -z "${db_type}" ]; then
40    db_type="${default_db_type}"
41 fi
42
43 echo "Dropping ${db_type} database"
44 @scriptdir@/drop_${db_type}_database $*