]> xmof Git - DeDRM.git/commitdiff
support fetching mac address on linux
authorRaphaël Droz <raphael.droz+floss@gmail.com>
Mon, 1 Jan 2018 17:46:03 +0000 (14:46 -0300)
committerGitHub <noreply@github.com>
Mon, 1 Jan 2018 17:46:03 +0000 (14:46 -0300)
support fetching mac address on linux

Other_Tools/Kobo/obok.py

index 033c67a3f018de0ff1a869c8314cd37a826633f1..2a3579540fde185b90647777a549e301d0e1a6a0 100755 (executable)
@@ -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)