Merge pull request #33 from xdavidhu/master

getDefaultInterfaceMAC() fix
This commit is contained in:
Nikolaos Kamarinakis 2017-02-03 13:23:31 +02:00 committed by GitHub
commit db529f9fa6

View File

@ -264,6 +264,14 @@ def getGatewayIP():
def getDefaultInterfaceMAC(): def getDefaultInterfaceMAC():
try: try:
defaultInterfaceMac = get_if_hwaddr(defaultInterface) defaultInterfaceMac = get_if_hwaddr(defaultInterface)
if defaultInterfaceMac == "" or not defaultInterfaceMac:
print(
"\n{0}ERROR: Default Interface MAC Address could not be obtained. Please enter MAC manually.{1}\n").format(
RED, END)
header = ('{0}kickthemout{1}> {2}Enter MAC Address {3}(MM:MM:MM:SS:SS:SS): '.format(BLUE, WHITE, RED, END))
defaultInterfaceMac = raw_input(header)
return defaultInterfaceMac
else:
return defaultInterfaceMac return defaultInterfaceMac
except: except:
print("\n{0}ERROR: Default Interface MAC Address could not be obtained. Please enter MAC manually.{1}\n").format(RED, END) print("\n{0}ERROR: Default Interface MAC Address could not be obtained. Please enter MAC manually.{1}\n").format(RED, END)