#!/bin/sh # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" if [ "${SSH_ORIGINAL_COMMAND%% *}" = "get-assignment" ] || \ [ "${SSH_ORIGINAL_COMMAND%% *}" = "return-assignment" ]; then export slave="$1" # this is somewhat cumbersome, but we want: # - no expansion of special shell-chars (*,;,\n,&&,~,$HOME) # - splitting of arguments on spaces echo "${SSH_ORIGINAL_COMMAND#* }" | \ xargs "${base_dir}/bin/${SSH_ORIGINAL_COMMAND%% *}" else >&2 echo "Invalid command: '${SSH_ORIGINAL_COMMAND%% *}'" exit 42 fi