From 6dffa7c3c6dc71b70dac9a2bd24faf6825fbe63f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 26 Jun 2018 11:49:55 +0200 Subject: lib/load-configuration,lib/mysql-functions: make runable outside of build-master in build-master mode --- lib/mysql-functions | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'lib/mysql-functions') diff --git a/lib/mysql-functions b/lib/mysql-functions index c7c87f0..2fccf46 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -62,19 +62,21 @@ mysql_run_query() { # a present query_file means there was an error if [ -f "${query_stdin}" ]; then >&2 printf 'I could not complete a mysql query!\n' - if [ ! -s "${work_dir}/build-master-sanity" ] && \ - [ -z "${file_name_extra}" ]; then - printf '\001ACTION failed to execute a mysql query - can you have a look at "%s"?.\001\n' \ - "${query_stdin##*/}" \ - | irc_say + if ${i_am_the_master}; then + if [ ! -s "${work_dir}/build-master-sanity" ] && \ + [ -z "${file_name_extra}" ]; then + printf '\001ACTION failed to execute a mysql query - can you have a look at "%s"?.\001\n' \ + "${query_stdin##*/}" \ + | irc_say + fi + for file in \ + "${query_stdin}" \ + "${query_stdout}" \ + "${query_stderr}"; do + cp "${file}" "${webserver_directory}/mysql-queries/${file##*/}.txt" + chmod go+r "${webserver_directory}/mysql-queries/${file##*/}.txt" + done fi - for file in \ - "${query_stdin}" \ - "${query_stdout}" \ - "${query_stderr}"; do - cp "${file}" "${webserver_directory}/mysql-queries/${file##*/}.txt" - chmod go+r "${webserver_directory}/mysql-queries/${file##*/}.txt" - done if [ -z "${file_name_extra}" ]; then echo 'A mysql query failed.' > \ "${work_dir}/build-master-sanity" -- cgit v1.2.3-54-g00ecf