summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-07-05 15:50:12 +0200
committerErich Eckner <git@eckner.net>2018-07-05 15:50:12 +0200
commita4b94e21dc895f796e8a89be14416c8f949474ab (patch)
tree31085086f41539715772db43e79caa7385dc229c
parent8b132baaa12c16f49f660f96fc32f6827940173c (diff)
downloadbuilder-a4b94e21dc895f796e8a89be14416c8f949474ab.tar.xz
bin/bootstrap-mysql: make granting of privileges optional
-rwxr-xr-xbin/bootstrap-mysql32
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