Put interfaces up and start Network Manager after exit

This commit is contained in:
Vinicius Henrique Marangoni
2016-12-28 13:41:31 -02:00
parent 5be2ea32f9
commit d3b966d8d8
3 changed files with 18 additions and 3 deletions

View File

@@ -92,10 +92,11 @@ class Interface(object):
mac_regex = ('[a-zA-Z0-9]{2}-' * 6)[:-1]
match = re.search('HWaddr (%s)' % mac_regex, output)
if not match:
raise Exception('Could not find the mac address for %s' % iface)
match = re.search('unspec (%s)' % mac_regex, output)
if not match:
raise Exception('Could not find the mac address for %s' % iface)
return match.groups()[0].replace('-', ':')
if __name__ == '__main__':
mac = Interface.get_mac()
print 'wlan0mon mac address:', mac