]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/make_bacula_tables.in
Backport from BEE
[bacula/bacula] / bacula / src / cats / make_bacula_tables.in
1 #!/bin/sh
2 #
3 # This routine makes the appropriately configured
4 # Bacula tables for PostgreSQL, Ingres, MySQL, or SQLite.
5 #
6 #
7 #  Bacula® - The Network Backup Solution
8 #
9 #  Copyright (C) 2000-2014 Free Software Foundation Europe e.V.
10 #
11 #  The main author of Bacula is Kern Sibbald, with contributions from many
12 #  others, a complete list can be found in the file AUTHORS.
13 #
14 #  You may use this file and others of this release according to the
15 #  license defined in the LICENSE file, which includes the Affero General
16 #  Public License, v3.0 ("AGPLv3") and some additional permissions and
17 #  terms pursuant to its AGPLv3 Section 7.
18 #
19 #  Bacula® is a registered trademark of Kern Sibbald.
20 #
21
22 default_db_type=@DEFAULT_DB_TYPE@
23
24 #
25 # See if the first argument is a valid backend name.
26 # If so the user overrides the default database backend.
27 #
28 if [ $# -gt 0 ]; then
29    case $1 in
30      sqlite3)
31        db_type=$1
32        shift
33        ;;
34      mysql)
35        db_type=$1
36        shift
37        ;;
38      postgresql)
39        db_type=$1
40        shift
41        ;;
42      ingres)
43        db_type=$1
44        shift
45        ;;
46      *)
47        ;;
48    esac
49 fi
50
51 #
52 # If no new db_type is gives use the default db_type.
53 #
54 if [ -z "${db_type}" ]; then
55    db_type="${default_db_type}"
56 fi
57
58 echo "Making ${db_type} tables"
59 @scriptdir@/make_${db_type}_tables $*