mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-14 21:10:11 +01:00
iup: wait_for_default_gateway: add interface for ping
This commit is contained in:
parent
dcdb147f2f
commit
537f4c4686
1 changed files with 5 additions and 1 deletions
|
|
@ -450,15 +450,19 @@ parse_dhcp_options()
|
|||
wait_for_default_gateway()
|
||||
{
|
||||
local gateway
|
||||
local device
|
||||
local wait_time=60
|
||||
local wait_interval=5
|
||||
|
||||
while [ true ] ; do
|
||||
|
||||
gateway=""
|
||||
device=""
|
||||
network_flush_cache
|
||||
network_get_gateway gateway wan #true
|
||||
if ping -q -w 1 -c 1 $gateway >/dev/null 2>&1 ; then
|
||||
network_get_device device wan
|
||||
device="${device:+-I }$device"
|
||||
if ping -q -w 1 -c 1 $device $gateway >/dev/null 2>&1 ; then
|
||||
[ "$wait_time" -lt "60" ] && v "Default gateway $gateway is reachable"
|
||||
sleep $wait_interval
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue