summaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/scripts/docker_login.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-os-chef/scripts/docker_login.sh')
-rw-r--r--sdc-os-chef/scripts/docker_login.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/sdc-os-chef/scripts/docker_login.sh b/sdc-os-chef/scripts/docker_login.sh
new file mode 100644
index 0000000000..15544f4d24
--- /dev/null
+++ b/sdc-os-chef/scripts/docker_login.sh
@@ -0,0 +1,8 @@
+pat=$1
+docker_ids=`docker ps | grep ${pat} | awk '{print $1}'|head -1`
+if [ -z "$docker_ids" ]; then
+ echo "No dockers were found matching pattern [${pat}]"
+ exit 0
+else
+ docker exec -it ${docker_ids} bash
+fi