mirror of
https://github.com/gryf/wicd.git
synced 2025-12-29 09:52:31 +01:00
Detect which flavour of ping(1) is installed
This is needed because inetutils-ping does not support
"-w deadline", but just waits timeout.
This commit is contained in:
@@ -738,7 +738,16 @@ class BaseInterface(object):
|
||||
trying to ping it.
|
||||
|
||||
"""
|
||||
cmd = "ping -q -w 3 -c 1 %s" % gateway
|
||||
if "iputils" in misc.Run(["ping", "-V"]):
|
||||
cmd = "ping -q -w 3 -c 1 %s" % gateway
|
||||
else:
|
||||
# ping is from inetutils-ping (which doesn't support -w)
|
||||
# or from some other package
|
||||
#
|
||||
# If there's no AP association, this will wait for
|
||||
# timeout, while the above will wait (-w) 3 seconds at
|
||||
# most.
|
||||
cmd = "ping -q -c 1 %s" % gateway
|
||||
if self.verbose: print cmd
|
||||
return misc.LaunchAndWait(cmd)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user