hwid 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hwid/base.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df9b22d944cd80752570ecab0e5166e41346de4120ddb27f0bf9a52e9d5e4a43
|
4
|
+
data.tar.gz: b37f213684bf33c0c29e0ced30b4c7fd293e287df608f781812667c36d1c45f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cddbba729bbdfe16009db4847f01e897c24ec712666822a7bfe128105d45c090a527a5584001f33287038a9d457bc4356210ce2f1da70b80ffa062961e426e9
|
7
|
+
data.tar.gz: 6826a8ae18f63f7431c5ebc82b7bde80698d78139ded1e4179c175e22b1fb81484be59a2e5b62dfff6eea4f5ceb4c79b07f24c8f8bb02df09ae62282159455a3
|
data/lib/hwid/base.rb
CHANGED
@@ -40,6 +40,7 @@ module Hwid
|
|
40
40
|
return get_rasp_id if platform.include?("raspberry")
|
41
41
|
return get_rasp_id if platform.include?("raspberry 2")
|
42
42
|
return get_mac_id if platform.include?("mac")
|
43
|
+
return get_windows_id if platform.include?("Microsoft")
|
43
44
|
return get_linuxdebian_id if platform.include?("debian") #virtaul box ??
|
44
45
|
return get_linuxdebian_id if platform.include?("ubuntu") #virtaul box ??
|
45
46
|
return get_linux_id if platform.include?("linux")
|
@@ -57,6 +58,19 @@ module Hwid
|
|
57
58
|
res=run_cmd('grep Serial /proc/cpuinfo')
|
58
59
|
self.parse(res)
|
59
60
|
end
|
61
|
+
def get_windows_id
|
62
|
+
puts "running windows linux sigh"
|
63
|
+
res=run_cmd("lshw -quiet -class network -disable usb -disable pci -disable cpuinfo -disable dmi -disable memory -disable isapnp -disable ide -disable device-tree -disable spd | grep -oP '(serial: )\\K.*'")
|
64
|
+
res=res.gsub("0000-","")
|
65
|
+
res=res.gsum(":","")
|
66
|
+
res=res.gsub("\n","")
|
67
|
+
#res=run_cmd("lshw | grep -A 10 '*-cpu' | grep -oP '(serial: )\\K.*'")
|
68
|
+
#puts "Interim result is #{res.inspect}"
|
69
|
+
res=res.chomp
|
70
|
+
puts "windows command result: #{res}"
|
71
|
+
res
|
72
|
+
end
|
73
|
+
|
60
74
|
def get_mac_id
|
61
75
|
res=run_cmd('/usr/sbin/system_profiler SPHardwareDataType -timeout 5 | grep Serial')
|
62
76
|
self.parse(res)
|