Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/slave-build-connect
diff options
context:
space:
mode:
Diffstat (limited to 'bin/slave-build-connect')
-rwxr-xr-xbin/slave-build-connect22
1 files changed, 18 insertions, 4 deletions
diff --git a/bin/slave-build-connect b/bin/slave-build-connect
index 7c6dedc..8e9dbcf 100755
--- a/bin/slave-build-connect
+++ b/bin/slave-build-connect
@@ -16,14 +16,28 @@ if [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xget-assignment' ] || \
fi
- printf '%s %s %s\n' "$(date '+%F %T')" "$1" "${SSH_ORIGINAL_COMMAND}" >> \
- "${work_dir}/ssh-log"
-
# shellcheck disable=SC2016
{
+ printf 'INSERT INTO `ssh_log` (`date`,`build_slave`,`action`,`parameters`)'
+ printf ' SELECT NOW(),`build_slaves`.`id`'
+ printf ',from_base64("%s")' \
+ "$(
+ print '%s' "${SSH_ORIGINAL_COMMAND%% *}" | \
+ base64 -w0
+ )" \
+ "$(
+ print '%s' "${#* }" | \
+ base64 -w0
+ )"
+ printf ' FROM `build_slaves`'
+ printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \
+ "$(
+ printf '%s' "$1" | \
+ base64 -w0
+ )"
printf 'UPDATE `build_slaves`'
printf ' SET `build_slaves`.`last_connection`=NOW()'
- printf ' WHERE `build_slaves`.`name`=from_base64("%s")\n' \
+ printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \
"$(
printf '%s' "$1" | \
base64 -w0