1#!/bin/sh 2# 3# Copyright (C) 2000-2015 Kern Sibbald 4# License: BSD 2-Clause; see file LICENSE-FOSS 5# 6# Drop Bacula database -- works for whatever is configured, 7# MySQL, SQLite, PostgreSQL, Ingres 8# 9 10default_db_type=@DEFAULT_DB_TYPE@ 11 12# 13# See if the first argument is a valid backend name. 14# If so the user overrides the default database backend. 15# 16if [ $# -gt 0 ]; then 17 case $1 in 18 sqlite3) 19 db_type=$1 20 shift 21 ;; 22 mysql) 23 db_type=$1 24 shift 25 ;; 26 postgresql) 27 db_type=$1 28 shift 29 ;; 30 *) 31 ;; 32 esac 33fi 34 35# 36# If no new db_type is gives use the default db_type. 37# 38if [ -z "${db_type}" ]; then 39 db_type="${default_db_type}" 40fi 41 42echo "Dropping ${db_type} database" 43@scriptdir@/drop_${db_type}_database $* 44