Fix detect dhcp by udhcpc

master3.3
Mike Hiretsky 12 years ago
parent 23ed0ce2e7
commit 815fd14b3f

@ -153,8 +153,9 @@ def isIpInNet(checkip,*ipnets):
def isDhcpIp(interface="eth0"): def isDhcpIp(interface="eth0"):
"""Get ip by dhcp or static""" """Get ip by dhcp or static"""
# dhclient # dhclients (dhcpcd, dhclient (dhcp), udhcpc (busybox)
if filter(lambda x:interface in x and ("dhcpcd" in x or "dhclient" in x), dhcpProgs = ("dhcpcd","dhclient","udhcpc")
if filter(lambda x:interface in x and any(prog in x for prog in dhcpProgs),
getRunCommands()): getRunCommands()):
return True return True
else: else:

Loading…
Cancel
Save