diff options
author | Erich Eckner <git@eckner.net> | 2018-07-05 15:50:12 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-07-05 15:50:12 +0200 |
commit | a4b94e21dc895f796e8a89be14416c8f949474ab (patch) | |
tree | 31085086f41539715772db43e79caa7385dc229c /bin/bootstrap-mysql | |
parent | 8b132baaa12c16f49f660f96fc32f6827940173c (diff) | |
download | builder-a4b94e21dc895f796e8a89be14416c8f949474ab.tar.xz |
bin/bootstrap-mysql: make granting of privileges optional
Diffstat (limited to 'bin/bootstrap-mysql')
-rwxr-xr-x | bin/bootstrap-mysql | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql index 15712c6..3d0a348 100755 --- a/bin/bootstrap-mysql +++ b/bin/bootstrap-mysql @@ -617,20 +617,22 @@ fi printf 'DELIMITER ;\n' - printf 'GRANT %s ON %s TO '"'"'buildmaster'"'"'@'"'"'localhost'"'"';\n' \ - 'CREATE ROUTINE' 'buildmaster.*' \ - 'CREATE TEMPORARY TABLES' 'buildmaster.*' \ - 'EXECUTE' 'buildmaster.*' \ - 'RELOAD' '*.*' \ - 'SELECT' 'buildmaster.*' \ - 'SELECT' 'mysql.proc' \ - 'SHOW VIEW' 'buildmaster.*' \ - 'UPDATE' 'buildmaster.*' - printf 'GRANT %s ON %s TO '"'"'webserver'"'"'@'"'"'localhost'"'"';\n' \ - 'CREATE TEMPORARY TABLES' 'buildmaster.*' \ - 'EXECUTE' 'buildmaster.*' \ - 'SELECT' 'buildmaster.*' \ - 'SHOW VIEW' 'buildmaster.*' - printf 'FLUSH PRIVILEGES;\n' + if [ "x$1" != 'x-no-privileges' ]; then + printf 'GRANT %s ON %s TO '"'"'buildmaster'"'"'@'"'"'localhost'"'"';\n' \ + 'CREATE ROUTINE' 'buildmaster.*' \ + 'CREATE TEMPORARY TABLES' 'buildmaster.*' \ + 'EXECUTE' 'buildmaster.*' \ + 'RELOAD' '*.*' \ + 'SELECT' 'buildmaster.*' \ + 'SELECT' 'mysql.proc' \ + 'SHOW VIEW' 'buildmaster.*' \ + 'UPDATE' 'buildmaster.*' + printf 'GRANT %s ON %s TO '"'"'webserver'"'"'@'"'"'localhost'"'"';\n' \ + 'CREATE TEMPORARY TABLES' 'buildmaster.*' \ + 'EXECUTE' 'buildmaster.*' \ + 'SELECT' 'buildmaster.*' \ + 'SHOW VIEW' 'buildmaster.*' + printf 'FLUSH PRIVILEGES;\n' + fi } | \ mysql_run_query -u root -p |