Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/ping-from-slave
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ping-from-slave')
-rwxr-xr-xbin/ping-from-slave28
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/ping-from-slave b/bin/ping-from-slave
index 92bee57..e163649 100755
--- a/bin/ping-from-slave
+++ b/bin/ping-from-slave
@@ -23,3 +23,31 @@ if [ "$(
>&2 echo 'You do not build anything currently - abort whatever you are doing.'
exit 2
fi
+
+log_lines=$(cat)
+
+if [ -n "${log_lines}" ]; then
+
+ # shellcheck disable=SC2016
+ {
+ printf 'UPDATE `build_slaves`'
+ printf ' SET `build_slaves`.`logged_lines`=from_base64("%s")' \
+ "$(
+ printf '%s' "$((
+ $(
+ printf '%s' "${log_lines}" | \
+ cut -d' ' -f1 | \
+ tr '\n' '+'
+ )0))" | \
+ base64 -w0
+ )"
+ printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \
+ "$(
+ printf '%s' "${slave}" | \
+ base64 -w0
+ )"
+ } | \
+ tee /tmp/ping-from-slave.query | \
+ mysql_run_query
+
+fi