mirror of
https://github.com/k4m4/kickthemout.git
synced 2024-11-25 14:34:23 +01:00
getDefaultInterfaceMAC()
This commit is contained in:
parent
9cc143be87
commit
e8a8855fde
@ -257,14 +257,27 @@ def getGatewayIP():
|
|||||||
return gatewayIP
|
return gatewayIP
|
||||||
|
|
||||||
def getDefaultInterfaceMAC():
|
def getDefaultInterfaceMAC():
|
||||||
|
getDefaultInterfaceMACManually = False
|
||||||
try:
|
try:
|
||||||
defaultInterfaceMac = get_if_hwaddr(defaultInterface)
|
defaultInterfaceMac = get_if_hwaddr(defaultInterface)
|
||||||
return defaultInterfaceMac
|
|
||||||
|
if defaultInterfaceMac == "" or not defaultInterfaceMac:
|
||||||
|
getDefaultInterfaceMACManually = True
|
||||||
|
else:
|
||||||
|
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)
|
getDefaultInterfaceMACManually = True
|
||||||
header = ('{0}kickthemout{1}> {2}Enter MAC Address {3}(MM:MM:MM:SS:SS:SS): '.format(BLUE, WHITE, RED, END))
|
|
||||||
defaultInterfaceMac = raw_input(header)
|
if getDefaultInterfaceMACManually:
|
||||||
return defaultInterfaceMac
|
print("\n{0}{1}ERROR: Your Default Interface's ({2}" + defaultInterface + "{3}) MAC Address could not be obtained.\n\tPlease enter it manually.{4}\n").format(GREEN, RED, GREEN, RED, END)
|
||||||
|
header = ("{0}kickthemout{1}> {2}{3}{4}'s MAC Address {5}(MM:MM:MM:SS:SS:SS): ".format(BLUE, WHITE, GREEN, defaultInterface, RED, END))
|
||||||
|
try:
|
||||||
|
defaultInterfaceMac = raw_input(header)
|
||||||
|
return defaultInterfaceMac
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print('\n\n{0}Thanks for dropping by.'
|
||||||
|
'\nCatch ya later!{1}').format(GREEN, END)
|
||||||
|
raise SystemExit
|
||||||
|
|
||||||
def resolveMac(mac):
|
def resolveMac(mac):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user