We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6816c53 commit 1dc3c51Copy full SHA for 1dc3c51
1 file changed
main.py
@@ -11,13 +11,20 @@
11
import json
12
import sys
13
import platform
14
+import os
15
+import subprocess
16
17
def get_serial_number():
18
try:
19
system = platform.system()
20
+ print(system)
21
if system == 'Windows':
22
return platform.win32_machineserial()
23
elif system == 'Linux':
24
+ if os.geteuid() != 0:
25
+ print("Process needs to be root.")
26
+ subprocess.call(['sudo','-E', 'python3', *sys.argv])
27
+ sys.exit()
28
with open('/sys/class/dmi/id/product_serial') as f:
29
return f.read().strip()
30
elif system == 'Darwin':
0 commit comments