Skip to content

Commit f5c1c09

Browse files
authored
Merge pull request crowbar#2344 from bmwiedemann/bsc985556
sledgehammer: wait for network (bsc#985556)
2 parents 826a691 + 1ce3bc0 commit f5c1c09

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sledgehammer/start-up.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,13 @@ echo "*.* @@${ADMIN_IP}" >> /etc/rsyslog.conf
150150
service $RSYSLOGSERVICE restart
151151

152152
# Sometimes at this point network is not up yet, wait for it
153-
echo "Waiting for admin server ($ADMIN_IP) to be reachable; will wait up to 60 seconds..."
154-
ping -c 1 -w 60 $ADMIN_IP > /dev/null || {
153+
n=60
154+
echo "Waiting for admin server ($ADMIN_IP) to be reachable; will wait up to $n seconds..."
155+
while (( $n > 0 )) && ! ping -q -c 1 -w 1 $ADMIN_IP > /dev/null ; do
156+
sleep 1
157+
let n--
158+
done
159+
(( $n > 0 )) || {
155160
echo "Admin server ($ADMIN_IP) not reachable."
156161
echo "Things will end badly."
157162
}

0 commit comments

Comments
 (0)