1
0
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:
David Paleino
2011-02-06 18:22:14 +01:00
parent a2eed5f352
commit 6ad648f13c

View File

@@ -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)