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