From 82a45c6d0e43ed0aa10c3473c69294ce545e7e09 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 20 Jun 2018 13:42:55 +0200 Subject: bin/ping-from-slave: talk to operators in pms --- bin/ping-from-slave | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/ping-from-slave b/bin/ping-from-slave index 26fd8c9..94fa1c8 100755 --- a/bin/ping-from-slave +++ b/bin/ping-from-slave @@ -42,17 +42,21 @@ if [ "${status% *}" != '1' ]; then printf ' SET `build_slaves`.`is_sane`=0' printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \ "$(printf '%s' "${slave}" | base64 -w0)" - printf 'SELECT CONCAT(' - printf '`persons`.`name`,": Your buildslave \\"",' - printf '`build_slaves`.`name`,"\\" builds some outdated package."' - printf ') FROM `build_slaves`' + printf 'SELECT' + printf ' `persons`.`name`,' + printf '`build_slaves`.`name`' + printf ' FROM `build_slaves`' mysql_join_build_slaves_ssh_keys mysql_join_ssh_keys_persons printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \ "$(printf '%s' "${slave}" | base64 -w0)" } | \ mysql_run_query | \ - irc_say + while read -r operator slave; do + printf '/j %s Your buildslave "%s" builds some outdated package.\n' \ + "${operator}" "${slave}" | \ + sponge "${irc_dir}/in" + done fi fi exit 2 -- cgit v1.2.3-70-g09d2