hwid 0.3.6 → 0.4.3
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/bin/hwid.rb +1 -1
- data/lib/hwid.rb +1 -1
- data/lib/hwid/base.rb +7 -4
- 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: c96072e38d1e5e0588ee1e07933040f4a73e8575525d5259c94adac3b37196e0
|
4
|
+
data.tar.gz: 912ad6268eb868d51acf35458ee2fcfae60fbfe3515312d798a54fa4f3663ec9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0076ee5b029f906868342c64c9e46163c10afe5dbf811ff3690bbf9fa075becb110a9660c24e2329f045f1b50039007f6eb6a352399b052b29abc7e7e3813ae7
|
7
|
+
data.tar.gz: 774f65b97b8031f24d03d3ae395cba55335378fa0ea22006af033c26c6304d2ea8628a7a85b99c49d0bf2692cb263b55b85cb39ba5c0b089a50ac87217f1ba7d
|
data/bin/hwid.rb
CHANGED
data/lib/hwid.rb
CHANGED
data/lib/hwid/base.rb
CHANGED
@@ -22,6 +22,7 @@ module Hwid
|
|
22
22
|
# returns array of platforms
|
23
23
|
def get_platform
|
24
24
|
platform=[]
|
25
|
+
puts "Unname is `uname -a`"
|
25
26
|
platform << "raspberry" if (/arm-linux/ =~ RUBY_PLATFORM) != nil and `uname -a`.include?('armv6')
|
26
27
|
platform << "raspberry" if `uname -a`.include?('armv6')
|
27
28
|
platform << "raspberry 2" if (/armv7l-linux/ =~ RUBY_PLATFORM) != nil and !`uname -a`.include?('armv6')
|
@@ -29,6 +30,7 @@ module Hwid
|
|
29
30
|
platform << "arm" if (/arm/ =~ RUBY_PLATFORM) != nil
|
30
31
|
platform << "x86" if (/x86/ =~ RUBY_PLATFORM) != nil
|
31
32
|
platform << "i686" if (/i686/ =~ RUBY_PLATFORM) != nil
|
33
|
+
platform << "microsoft" if `uname -a`.include?('Microsoft')
|
32
34
|
platform << "debian" if `uname -a`.include?('Debian')
|
33
35
|
platform << "ubuntu" if `uname -a`.include?('Ubuntu')
|
34
36
|
platform << "linux" if (/linux/ =~ RUBY_PLATFORM) != nil
|
@@ -36,11 +38,11 @@ module Hwid
|
|
36
38
|
end
|
37
39
|
def systemid
|
38
40
|
platform=get_platform
|
39
|
-
|
41
|
+
puts "debug: platform is #{platform} #{RUBY_PLATFORM}"
|
40
42
|
return get_rasp_id if platform.include?("raspberry")
|
41
43
|
return get_rasp_id if platform.include?("raspberry 2")
|
42
44
|
return get_mac_id if platform.include?("mac")
|
43
|
-
return get_windows_id if platform.include?("
|
45
|
+
return get_windows_id if platform.include?("microsoft")
|
44
46
|
return get_linuxdebian_id if platform.include?("debian") #virtaul box ??
|
45
47
|
return get_linuxdebian_id if platform.include?("ubuntu") #virtaul box ??
|
46
48
|
return get_linux_id if platform.include?("linux")
|
@@ -60,10 +62,11 @@ module Hwid
|
|
60
62
|
end
|
61
63
|
def get_windows_id
|
62
64
|
puts "running windows linux sigh"
|
63
|
-
res=run_cmd("lshw -quiet -class network -disable usb
|
65
|
+
res=run_cmd("lshw -quiet -class network -disable usb -disable spd | grep -oP '(serial: )\\K.*'")
|
64
66
|
res=res.gsub("0000-","")
|
65
|
-
res=res.
|
67
|
+
res=res.gsub(":","")
|
66
68
|
res=res.gsub("\n","")
|
69
|
+
res=res.gsub(" ","")
|
67
70
|
#res=run_cmd("lshw | grep -A 10 '*-cpu' | grep -oP '(serial: )\\K.*'")
|
68
71
|
#puts "Interim result is #{res.inspect}"
|
69
72
|
res=res.chomp
|