]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/cats/grant_mysql_privileges.in
Doc + DB script updates
[bacula/bacula] / bacula / src / cats / grant_mysql_privileges.in
1 #!/bin/sh
2 #
3 # shell script to grant privileges to the bacula database
4 #
5 USER=bacula
6 bindir=@SQL_BINDIR@
7
8 if $bindir/mysql $* -u root -f <<END-OF-DATA
9 use mysql
10 grant all privileges on bacula.* to ${USER}@localhost with grant option;
11 grant all privileges on bacula.* to ${USER}@"%" with grant option;
12 select * from user;
13 flush privileges;
14 END-OF-DATA
15 then
16    echo "Privileges for ${USER} granted."
17    exit 0
18 else
19    echo "Error creating privileges."
20    exit 1
21 fi