mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 21:08:06 +01:00
Testing/Experimental:
- Added check to make sure wpa_cli is installed, and make sure not to try to validate authentication if it isn't. Experimental: - Increased length of sleep time before checking for an active link when the wired interface has to be put up explicitly.
This commit is contained in:
14
wnettools.py
14
wnettools.py
@@ -310,12 +310,22 @@ class Interface(object):
|
|||||||
else:
|
else:
|
||||||
self.ethtool_cmd = None
|
self.ethtool_cmd = None
|
||||||
self.ETHTOOL_FOUND = False
|
self.ETHTOOL_FOUND = False
|
||||||
|
|
||||||
|
def CheckWirelessTools(self):
|
||||||
|
""" Check for the existence of wpa_cli """
|
||||||
|
wpa_cli_path = self._find_client_path("wpa_cli")
|
||||||
|
if wpa_cli_path:
|
||||||
|
self.WPA_CLI_FOUND = True
|
||||||
|
else:
|
||||||
|
self.WPA_CLI_FOUND = False
|
||||||
|
print "wpa_cli not found. Authentication will not be validated."
|
||||||
|
|
||||||
def Check(self):
|
def Check(self):
|
||||||
""" Check that all required tools are available. """
|
""" Check that all required tools are available. """
|
||||||
# THINGS TO CHECK FOR: ethtool, pptp-linux, dhclient, host
|
# THINGS TO CHECK FOR: ethtool, pptp-linux, dhclient, host
|
||||||
self.CheckDHCP()
|
self.CheckDHCP()
|
||||||
self.CheckWiredTools()
|
self.CheckWiredTools()
|
||||||
|
self.CheckWirelessTools()
|
||||||
|
|
||||||
ip_path = self._find_client_path("ip")
|
ip_path = self._find_client_path("ip")
|
||||||
if ip_path:
|
if ip_path:
|
||||||
@@ -645,7 +655,7 @@ class WiredInterface(Interface):
|
|||||||
"""
|
"""
|
||||||
if not self.IsUp():
|
if not self.IsUp():
|
||||||
self.Up()
|
self.Up()
|
||||||
time.sleep(2.5)
|
time.sleep(5)
|
||||||
buff = array.array('i', [0x0000000a, 0x00000000])
|
buff = array.array('i', [0x0000000a, 0x00000000])
|
||||||
addr, length = buff.buffer_info()
|
addr, length = buff.buffer_info()
|
||||||
arg = struct.pack('Pi', addr, length)
|
arg = struct.pack('Pi', addr, length)
|
||||||
@@ -1041,7 +1051,7 @@ class WirelessInterface(Interface):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
# Right now there's no way to do this for these drivers
|
# Right now there's no way to do this for these drivers
|
||||||
if self.wpa_driver == RALINK_DRIVER:
|
if self.wpa_driver == RALINK_DRIVER or not self.WPA_CLI_FOUND:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
MAX_TIME = 15
|
MAX_TIME = 15
|
||||||
|
|||||||
Reference in New Issue
Block a user