From f0795d264728efadb32cf6485769bfcb12f81300 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 28 Jun 2019 09:44:08 +0200 Subject: lib/load-configuration: skip logging for useless commands --- lib/load-configuration | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3