From 7bbac98e3b6e28f32d6f56edc9136c9512fac621 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 1 Aug 2020 16:21:33 +0200 Subject: [PATCH] [viirb] wait until it comes online --- viirb-1-connect-flash-latest-openwrt.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/viirb-1-connect-flash-latest-openwrt.sh b/viirb-1-connect-flash-latest-openwrt.sh index c551ef1..f6b5a34 100755 --- a/viirb-1-connect-flash-latest-openwrt.sh +++ b/viirb-1-connect-flash-latest-openwrt.sh @@ -33,11 +33,10 @@ fi # don't care about other/old known_host entries ssh-keygen -R ${viirb_ip} -ping -c2 ${viirb_ip} -if [ $? -ne 0 ]; then - echo "Cannot reach any VIIRB - exiting" - exit 1 -fi +while ! ping -c1 ${viirb_ip}; do + echo "Cannot ping $viirb_ip yet - waiting" + sleep 1 +done cat ~/.ssh/id_rsa.pub | ssh root@${viirb_ip} "cat > /etc/dropbear/authorized_keys"