[base image files] All 'docker exec' wrapper scripts now dynamically adjust their flags depending on whether or not they are run on a terminal (#1507)

This commit is contained in:
Joe LeVeque 2018-03-17 00:43:29 -07:00 committed by lguohan
parent 066137e9d8
commit e1cb2ace36
7 changed files with 61 additions and 7 deletions

View File

@ -1,3 +1,10 @@
#!/bin/bash
docker exec -it database redis-cli "$@"
DOCKER_EXEC_FLAGS="i"
# Determine whether stdout is on a terminal
if [ -t 1 ] ; then
DOCKER_EXEC_FLAGS+="t"
fi
docker exec -$DOCKER_EXEC_FLAGS database redis-cli "$@"

View File

@ -1,2 +1,10 @@
#!/bin/bash
docker exec -it bgp vtysh "$@"
DOCKER_EXEC_FLAGS="i"
# Determine whether stdout is on a terminal
if [ -t 1 ] ; then
DOCKER_EXEC_FLAGS+="t"
fi
docker exec -$DOCKER_EXEC_FLAGS bgp vtysh "$@"

View File

@ -1,2 +1,10 @@
#!/bin/bash
docker exec -it bgp vtysh "$@"
DOCKER_EXEC_FLAGS="i"
# Determine whether stdout is on a terminal
if [ -t 1 ] ; then
DOCKER_EXEC_FLAGS+="t"
fi
docker exec -$DOCKER_EXEC_FLAGS bgp vtysh "$@"

View File

@ -1,2 +1,10 @@
#!/bin/bash
docker exec -i lldp lldpctl "$@"
DOCKER_EXEC_FLAGS="i"
# Determine whether stdout is on a terminal
if [ -t 1 ] ; then
DOCKER_EXEC_FLAGS+="t"
fi
docker exec -$DOCKER_EXEC_FLAGS lldp lldpctl "$@"

View File

@ -1,2 +1,10 @@
#!/bin/bash
docker exec -i swss swssloglevel "$@"
DOCKER_EXEC_FLAGS="i"
# Determine whether stdout is on a terminal
if [ -t 1 ] ; then
DOCKER_EXEC_FLAGS+="t"
fi
docker exec -$DOCKER_EXEC_FLAGS swss swssloglevel "$@"

View File

@ -1,2 +1,10 @@
#!/bin/bash
docker exec -i pmon sensors "$@"
DOCKER_EXEC_FLAGS="i"
# Determine whether stdout is on a terminal
if [ -t 1 ] ; then
DOCKER_EXEC_FLAGS+="t"
fi
docker exec -$DOCKER_EXEC_FLAGS pmon sensors "$@"

View File

@ -1,3 +1,10 @@
#!/bin/bash
docker exec -i teamd teamdctl "$@"
DOCKER_EXEC_FLAGS="i"
# Determine whether stdout is on a terminal
if [ -t 1 ] ; then
DOCKER_EXEC_FLAGS+="t"
fi
docker exec -$DOCKER_EXEC_FLAGS teamd teamdctl "$@"