]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/grant_bacula_privileges.in
Revert to using LGPLv3 for simple scripts
[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 #  Author:  Kern Sibbald
8 #  License: LGPLv3
9 #
10
11 default_db_type=@DEFAULT_DB_TYPE@
12
13 #
14 # See if the first argument is a valid backend name.
15 # If so the user overrides the default database backend.
16 #
17 if [ $# -gt 0 ]; then
18    case $1 in
19      sqlite3)
20        db_type=$1
21        shift
22        ;;
23      mysql)
24        db_type=$1
25        shift
26        ;;
27      postgresql)
28        db_type=$1
29        shift
30        ;;
31      ingres)
32        db_type=$1
33        shift
34        ;;
35      *)
36        ;;
37    esac
38 fi
39
40 #
41 # If no new db_type is gives use the default db_type.
42 #
43 if [ -z "${db_type}" ]; then
44    db_type="${default_db_type}"
45 fi
46
47 echo "Granting ${db_type} privileges"
48 @scriptdir@/grant_${db_type}_privileges $*