summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2018-05-27 08:48:34 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2018-05-27 18:18:12 +0000
commitcf010332cc53062694a9f86b3ae61b54db034b79 (patch)
treefe1f41e5010b5a829bf7a26ca95c1531657a0614
parentAdding missing command variable in some container commands. (diff)
downloadcompute-tools-cf010332cc53062694a9f86b3ae61b54db034b79.tar.xz
compute-tools-cf010332cc53062694a9f86b3ae61b54db034b79.zip
Setting dummy SSH_CLIENT variable during container enter to enable conditional shell prompts such as powerline.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
-rwxr-xr-xlib/container/enter8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/container/enter b/lib/container/enter
index 5d2d25c..72b3b1c 100755
--- a/lib/container/enter
+++ b/lib/container/enter
@@ -103,9 +103,17 @@ do
fi
done
+SSH_CLIENT="${SSH_CLIENT:-127.0.0.1 0 0}"
+
# Run
nsenter --all --target "${LEADER}" --wd="${MACHINES}/${NAME}/root" /usr/bin/script -c "/bin/bash -l" -q /dev/null
+case "${SSH_CLIENT}" in
+ 127.0.0.1*)
+ unset SSH_CLIENT
+ ;;
+esac
+
# Post hooks
for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}"
do