]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/grant_mysql_privileges.in
kes Make database name and user configurable
[bacula/bacula] / bacula / src / cats / grant_mysql_privileges.in
index aeafd65f1c32b6bcb44cc710708b1bf8ec339753..bf89fe060ad3a567daad37078498bb1209bfb4c2 100644 (file)
@@ -2,18 +2,19 @@
 #
 # shell script to grant privileges to the bacula database
 #
-USER=bacula
+USER=@db_user@
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
 if $bindir/mysql $* -u root -f <<END-OF-DATA
 use mysql
-grant all privileges on bacula.* to ${USER}@localhost;
-grant all privileges on bacula.* to ${USER}@"%";
+grant all privileges on ${db_name}.* to ${USER}@localhost;
+grant all privileges on ${db_name}.* to ${USER}@"%";
 select * from user;
 flush privileges;
 END-OF-DATA
 then
-   echo "Privileges for ${USER} granted."
+   echo "Privileges for ${USER} granted on ${db_name}."
    exit 0
 else
    echo "Error creating privileges."