From a033dadc060069ff475a47ef9745d855f94f90d7 Mon Sep 17 00:00:00 2001 From: Colin P. Mccabe Date: Tue, 29 Nov 2016 15:16:14 -0800 Subject: [PATCH] dssh: run ssh in the background when it's not being run interactively --- dssh | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dssh b/dssh index 7540c8b..14dd22c 100755 --- a/dssh +++ b/dssh @@ -50,10 +50,6 @@ if [ $# -eq 0 ]; then else RUN_COMMAND="${@}" fi -EXTRA_DOCKER_ARGS="" -if [ ${ALLOCATE_TTY} -ne 0 ]; then - EXTRA_DOCKER_ARGS="${EXTRA_DOCKER_ARGS} -t" -fi which docker &>/dev/null || die "docker must be on the PATH." @@ -74,4 +70,9 @@ else die "failed to find a docker image named ${DOCKER_IMAGE_NAME}" fi -docker exec -i ${EXTRA_DOCKER_ARGS} "${DOCKER_IMAGE_ID}" ${RUN_COMMAND} +if [ ${ALLOCATE_TTY} == 1 ]; then + docker exec -it "${DOCKER_IMAGE_ID}" ${RUN_COMMAND} +else + docker exec -i "${DOCKER_IMAGE_ID}" ${RUN_COMMAND} & + wait +fi -- 1.6.6.rc1.39.g9a42