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