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