summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2017-01-31 21:24:17 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2017-01-31 21:25:07 +0000
commit44f5b1edd967c14a63fe823eb0ac13232c3f953f (patch)
tree2396c4906906a07001f976141019e8ef8b4c6817
parent513172c486a4fb9ab011ec5fc3fe3a538f9aeb03 (diff)
start-container-docker.sh: Use ssh instead of telnet to detect if ssh server is ready.
check-server.exp: Delete, as it is now useless. Change-Id: I85d8d36a94bf8e412bc1dcc9eb0f1ca8fd541a6a
-rw-r--r--check-server.exp21
-rwxr-xr-xstart-container-docker.sh10
2 files changed, 2 insertions, 29 deletions
diff --git a/check-server.exp b/check-server.exp
deleted file mode 100644
index 83833fbd..00000000
--- a/check-server.exp
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/expect
-set timeout 20
-set ip [lindex $argv 0]
-set port [lindex $argv 1]
-
-spawn telnet $ip $port
-
-expect {
- "SSH"
- {
- send_user "OK\n"
- exit 0
- }
-
- "host: Connection refused"
- {
- send_user "ERROR: Connection refused!\n"
- exit 1
- }
-}
-
diff --git a/start-container-docker.sh b/start-container-docker.sh
index c84db4ce..06de7ed8 100755
--- a/start-container-docker.sh
+++ b/start-container-docker.sh
@@ -77,12 +77,6 @@ trap "$DOCKER rm -fv $session_id ; exec 1>&3 2>&4" EXIT
session_port=$($DOCKER port $session_id 22 | cut -d: -f 2)
-rundir="$(pwd -P)"
-mydir="$(dirname $0)"
-cd "${mydir}"
-mydir="$(pwd)"
-cd ${rundir}
-
# Wait until the ssh server is ready to serve connexions
# Make sure connexion messages go to stderr, so that in case of
@@ -91,9 +85,9 @@ cd ${rundir}
count=20
while [ $count -gt 0 ]
do
+ ssh -p $session_port -A $session_host true && break
+ echo SSH server not ready, waiting.....
sleep 5
- expect ${mydir}/check-server.exp ${session_host} ${session_port} && break
- echo SSH not ready, waiting.....
count=$((count - 1))
done