summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-06-28 09:44:08 +0200
committerErich Eckner <git@eckner.net>2019-06-28 09:44:08 +0200
commitf0795d264728efadb32cf6485769bfcb12f81300 (patch)
treed087a219215c7bac904424d9c4c23af8985a859d /lib
parent81ce0f9e99e7a11202a907ba9773a424475fc101 (diff)
downloadbuilder-f0795d264728efadb32cf6485769bfcb12f81300.tar.xz
lib/load-configuration: skip logging for useless commands
Diffstat (limited to 'lib')
-rwxr-xr-xlib/load-configuration49
1 files changed, 27 insertions, 22 deletions
diff --git a/lib/load-configuration b/lib/load-configuration
index e434b4b..5513584 100755
--- a/lib/load-configuration
+++ b/lib/load-configuration
@@ -200,26 +200,31 @@ if [ "${master_build_server_identity}" = "${work_dir}/.ssh/id_rsa" ] && \
fi
if ${i_am_the_master}; then
- # shellcheck disable=SC2016
- {
- printf 'INSERT INTO `command_log`(`command`,`parameters`,`shell`)'
- printf ' VALUES ('
- printf 'from_base64("%s"),' \
- "$(
- printf '%s' "${0##*/}" | \
- base64
- )"
- printf 'from_base64("%s"),' \
- "$(
- printf '%s' "$*" | \
- base64
- )"
- if tty -s; then
- printf '1'
- else
- printf '0'
- fi
- printf ');\n'
- } | \
- mysql_run_query 'unimportant'
+ command="${0##*/}"
+ # these commands are useless to log
+ if [ "${command}" != 'slave-build-connect' ] && \
+ [ "${command}" != 'ping-from-slave' ]; then
+ # shellcheck disable=SC2016
+ {
+ printf 'INSERT INTO `command_log`(`command`,`parameters`,`shell`)'
+ printf ' VALUES ('
+ printf 'from_base64("%s"),' \
+ "$(
+ printf '%s' "${command}" | \
+ base64
+ )"
+ printf 'from_base64("%s"),' \
+ "$(
+ printf '%s' "$*" | \
+ base64
+ )"
+ if tty -s; then
+ printf '1'
+ else
+ printf '0'
+ fi
+ printf ');\n'
+ } | \
+ mysql_run_query 'unimportant'
+ fi
fi