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"):
"""Get ip by dhcp or static"""
# dhclient
if filter(lambda x:interface in x and ("dhcpcd" in x or "dhclient" in x),
# dhclients (dhcpcd, dhclient (dhcp), udhcpc (busybox)
dhcpProgs = ("dhcpcd","dhclient","udhcpc")
if filter(lambda x:interface in x and any(prog in x for prog in dhcpProgs),
getRunCommands()):
return True
else:

Loading…
Cancel
Save