diff options
author | Erich Eckner <git@eckner.net> | 2018-01-19 15:12:18 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-01-19 15:12:18 +0100 |
commit | d45764513cfae3a0f67cb1e304cdc3e961f5be00 (patch) | |
tree | 21a11c00468ab4fd6f45a6a2c84939f445cd4000 | |
parent | 2079d087514a884302b06de9bd61f91ca3984cd4 (diff) | |
download | builder-d45764513cfae3a0f67cb1e304cdc3e961f5be00.tar.xz |
bin/slave-build-connect: log ssh connections to the mysql database
-rwxr-xr-x | bin/slave-build-connect | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/slave-build-connect b/bin/slave-build-connect index b1d3495..704a9da 100755 --- a/bin/slave-build-connect +++ b/bin/slave-build-connect @@ -18,6 +18,19 @@ if [ "${SSH_ORIGINAL_COMMAND%% *}" = "get-assignment" ] || \ printf '%s %s %s\n' "$(date '+%F %T')" "$1" "${SSH_ORIGINAL_COMMAND}" >> \ "${work_dir}/ssh-log" + ${mysql_command} -e "$( + # shellcheck disable=SC2016 + printf 'UPDATE `build_slaves`' + # shellcheck disable=SC2016 + printf ' SET `build_slaves`.`last_connection`=NOW' + # shellcheck disable=SC2016 + printf ' WHERE `build_slaves`.`name`=from_base64("%s")\n' \ + "$( + printf '%s' "$1" | \ + base64 -w0 + )" + )" + slave="$1" /bin/sh -c "${base_dir}/bin/${SSH_ORIGINAL_COMMAND}" else |