]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/make_bacula_tables.in
Revert to using LGPLv3 for simple scripts
[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 #  Author:  Kern Sibbald
7 #  License: LGPLv3
8 #
9
10 default_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 #
16 if [ $# -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      ingres)
31        db_type=$1
32        shift
33        ;;
34      *)
35        ;;
36    esac
37 fi
38
39 #
40 # If no new db_type is gives use the default db_type.
41 #
42 if [ -z "${db_type}" ]; then
43    db_type="${default_db_type}"
44 fi
45
46 echo "Making ${db_type} tables"
47 @scriptdir@/make_${db_type}_tables $*