diff options
author | Raphaƫl Droz <[email protected]> | 2018-01-01 14:46:03 -0300 |
---|---|---|
committer | GitHub <[email protected]> | 2018-01-01 14:46:03 -0300 |
commit | 20d445acb7f52488d91548971d73328cd67e4d39 (patch) | |
tree | f22d60a5f40d2d6569270af3dc9c30c03a82409d /Other_Tools | |
parent | a390d7a20773535346d5c72d981ca6650f69e3c7 (diff) |
support fetching mac address on linux
support fetching mac address on linux
Diffstat (limited to 'Other_Tools')
-rwxr-xr-x | Other_Tools/Kobo/obok.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Other_Tools/Kobo/obok.py b/Other_Tools/Kobo/obok.py index 033c67a..2a35795 100755 --- a/Other_Tools/Kobo/obok.py +++ b/Other_Tools/Kobo/obok.py @@ -449,6 +449,10 @@ class KoboLibrary(object): for m in matches: # print u"m:{0}".format(m[0]) macaddrs.append(m[0].upper()) + elif sys.platform.startswith('linux'): + p_out = subprocess.check_output("ip -br link show | awk '{print $3}'", shell=True) + for line in p_out: + macaddrs.append(line.upper()) else: # probably linux, let's try ipconfig under wine c = re.compile('\s(' + '[0-9a-f]{2}-' * 5 + '[0-9a-f]{2})(\s|$)', re.IGNORECASE) |