From 31dfe057f9b5667991f3c7809a13a87485f32ac6 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 6 Feb 2018 20:52:56 +0100 Subject: bin/ping-from-slave new --- bin/ping-from-slave | 11 +++++++++++ bin/slave-build-connect | 7 ++++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100755 bin/ping-from-slave diff --git a/bin/ping-from-slave b/bin/ping-from-slave new file mode 100755 index 0000000..4013269 --- /dev/null +++ b/bin/ping-from-slave @@ -0,0 +1,11 @@ +#!/bin/sh + +# should be called periodically on the build-master from the slaves to +# - report any update on the build process +# - show that the build is still running +# - get notified by the build master if the build is not necessary anymore + +# shellcheck source=conf/default.conf +. "${0%/*}/../conf/default.conf" + +# TODO: acutally do something here :-) diff --git a/bin/slave-build-connect b/bin/slave-build-connect index 2ca72a3..119592e 100755 --- a/bin/slave-build-connect +++ b/bin/slave-build-connect @@ -3,11 +3,12 @@ # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" -if [ "${SSH_ORIGINAL_COMMAND%% *}" = "get-assignment" ] || \ - [ "${SSH_ORIGINAL_COMMAND%% *}" = "return-assignment" ]; then +if [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xget-assignment' ] || \ + [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xreturn-assignment' ] || \ + [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xping-from-slave' ]; then # small check to prevent some shell-injections - if echo "${SSH_ORIGINAL_COMMAND}" | \ + if printf '%s\n' "${SSH_ORIGINAL_COMMAND}" | \ grep -q '[^-a-zA-Z0-9.+_ ]'; then >&2 printf 'Invalid command: "%s".\n' "${SSH_ORIGINAL_COMMAND}" -- cgit v1.2.3-70-g09d2