Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/mysql-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-18 21:14:55 +0200
committerErich Eckner <git@eckner.net>2018-04-18 21:14:55 +0200
commit70d1655a41aedd99768e469e3fed8636324d3b30 (patch)
tree09006af50d3b7df172ffc31b5f6075f196044dcb /lib/mysql-functions
parent97e0e4a78e314b0eea8099768de4c75760935b1e (diff)
lib/mysql-functions: save queries as *.txt
Diffstat (limited to 'lib/mysql-functions')
-rwxr-xr-xlib/mysql-functions11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 66b1512..0e4b952 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -30,6 +30,7 @@ mysql_run_query() {
local query_stderr
local file_name_extra
+ local file
file_name_extra=''
if [ "x$1" = 'xunimportant' ]; then
@@ -62,13 +63,13 @@ mysql_run_query() {
printf '\001ACTION failed to execute a mysql query - can you have a look at "%s"?.\001\n' \
"${query_stdin##*/}" \
| irc_say
- cp \
+ for file in \
"${query_stdin}" \
"${query_stdout}" \
- "${query_stderr}" \
- "${webserver_directory}/mysql-queries/"
- find "${webserver_directory}/mysql-queries/" -type f \
- -exec chmod go+r {} \;
+ "${query_stderr}"; do
+ cp "${file}" "${webserver_directory}/mysql-queries/${file}.txt"
+ chmod go+r "${webserver_directory}/mysql-queries/${file}.txt"
+ done
fi
if [ -z "${file_name_extra}" ]; then
echo 'A mysql query failed.' > \