Skip to content

Commit

Permalink
net-online: wait for ping_test_host
Browse files Browse the repository at this point in the history
The script should wait till the ping host is available or timeout reached
Closes : #179
Closes : #191
  • Loading branch information
bell07 authored and williamh committed Dec 12, 2017
1 parent 8bf501a commit 14938c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions init.d/net-online.in
Expand Up @@ -63,8 +63,12 @@ start ()
if [ $rc -eq 0 ] && yesno ${include_ping_test:-no}; then
ping_test_host="${ping_test_host:-google.com}"
if [ -n "$ping_test_host" ]; then
ping -c 1 $ping_test_host > /dev/null 2>&1
rc=$?
while $infinite || [ $timeout -gt 0 ]; do
ping -c 1 $ping_test_host > /dev/null 2>&1
rc=$?
[ $rc -eq 0 ] && break
: $((timeout -= 1))
done
fi
fi
eend $rc "The network is offline"
Expand Down

0 comments on commit 14938c2

Please sign in to comment.