Skip to content

Commit 57c0253

Browse files
committed
Use wait_for_sshd_start_up.sh in start_sshd.sh
Signed-off-by: Jiahao XU <[email protected]>
1 parent dc47074 commit 57c0253

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

start_sshd.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ chmod 600 .test-key
2828
mkdir -p "$RUNTIME_DIR/openssh-rs/"
2929

3030
echo Waiting for sshd to be up
31-
while ! ssh -i .test-key -v -p 2222 -l test-user $HOSTNAME -o StrictHostKeyChecking=no -o UserKnownHostsFile="$RUNTIME_DIR/openssh-rs/known_hosts" whoami; do
32-
sleep 3
33-
done
31+
timeout 30 ./wait_for_sshd_start_up.sh
32+
33+
# Add the ip to known_hosts file
34+
ssh -i .test-key -v -p 2222 -l test-user $HOSTNAME -o StrictHostKeyChecking=no -o UserKnownHostsFile="$RUNTIME_DIR/openssh-rs/known_hosts" whoami
3435

3536
# Create sshd_started in runtime directory so that it is auto removed on restart.
3637
touch "$RUNTIME_DIR/openssh-rs/sshd_started"

0 commit comments

Comments
 (0)