mirror of
https://github.com/noDRM/DeDRM_tools
synced 2025-02-07 08:46:02 +01:00
Merge pull request #421 from drzraf/patch-1
obok.py: support fetching mac address on linux
This commit is contained in:
commit
9b001bfaf3
1 changed files with 4 additions and 0 deletions
|
@ -449,6 +449,10 @@ class KoboLibrary(object):
|
||||||
for m in matches:
|
for m in matches:
|
||||||
# print u"m:{0}".format(m[0])
|
# print u"m:{0}".format(m[0])
|
||||||
macaddrs.append(m[0].upper())
|
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:
|
else:
|
||||||
# probably linux, let's try ipconfig under wine
|
# probably linux, let's try ipconfig under wine
|
||||||
c = re.compile('\s(' + '[0-9a-f]{2}-' * 5 + '[0-9a-f]{2})(\s|$)', re.IGNORECASE)
|
c = re.compile('\s(' + '[0-9a-f]{2}-' * 5 + '[0-9a-f]{2})(\s|$)', re.IGNORECASE)
|
||||||
|
|
Loading…
Add table
Reference in a new issue