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