3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # Drop Bacula tables -- works for whatever is configured,
7 # MySQL, SQLite, Ingres, or PostgreSQL
10 # can be used to change the current user with su
13 default_db_type=@DEFAULT_DB_TYPE@
16 # See if the first argument is a valid backend name.
17 # If so the user overrides the default database backend.
39 # If no new db_type is gives use the default db_type.
41 if [ -z "${db_type}" ]; then
42 db_type="${default_db_type}"
45 if [ $db_type = postgresql -a "$UID" = 0 ]; then
46 pre_command="su - postgres -c"
49 $pre_command "@scriptdir@/drop_${db_type}_tables $*"
50 echo "Dropped ${db_type} tables"