hwid 0.4.0 → 0.4.5
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 +8 -5
- 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: b384f4c14d3ebd601ab9522c3af3a6c03f69e27950056fa3301afb3b76dc6a7c
|
4
|
+
data.tar.gz: fc47de366908605cdf864baa2c271c00cb79b537ab236271f5277586952afa7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55c083bbb4e72f07e5a87c49a47e8352b3cf30d699becd0130a33d883f362458616c91e072213c72ebd772b4ee913122065c975e5aaf273c7a469a8bbb5ccc08
|
7
|
+
data.tar.gz: 157ed7d5230b5647ad9727317106f6360a9aa942c85238878200c3ba62bac68b50a6f0fabe764ca0c3d764273251c4a73467c7621f7ab66286423d1016010df1
|
data/bin/hwid.rb
CHANGED
data/lib/hwid.rb
CHANGED
data/lib/hwid/base.rb
CHANGED
@@ -22,6 +22,8 @@ module Hwid
|
|
22
22
|
# returns array of platforms
|
23
23
|
def get_platform
|
24
24
|
platform=[]
|
25
|
+
testos=`uname -a`
|
26
|
+
# puts "osname is #{testos}"
|
25
27
|
platform << "raspberry" if (/arm-linux/ =~ RUBY_PLATFORM) != nil and `uname -a`.include?('armv6')
|
26
28
|
platform << "raspberry" if `uname -a`.include?('armv6')
|
27
29
|
platform << "raspberry 2" if (/armv7l-linux/ =~ RUBY_PLATFORM) != nil and !`uname -a`.include?('armv6')
|
@@ -29,15 +31,15 @@ module Hwid
|
|
29
31
|
platform << "arm" if (/arm/ =~ RUBY_PLATFORM) != nil
|
30
32
|
platform << "x86" if (/x86/ =~ RUBY_PLATFORM) != nil
|
31
33
|
platform << "i686" if (/i686/ =~ RUBY_PLATFORM) != nil
|
32
|
-
platform << "
|
33
|
-
platform << "
|
34
|
-
platform << "ubuntu" if
|
34
|
+
platform << "microsoft" if testos.include?('Microsoft')
|
35
|
+
platform << "debian" if testos.include?('Debian')
|
36
|
+
platform << "ubuntu" if testos.include?('Ubuntu')
|
35
37
|
platform << "linux" if (/linux/ =~ RUBY_PLATFORM) != nil
|
36
38
|
platform
|
37
39
|
end
|
38
40
|
def systemid
|
39
41
|
platform=get_platform
|
40
|
-
|
42
|
+
# puts "debug: platform is #{platform} #{RUBY_PLATFORM}"
|
41
43
|
return get_rasp_id if platform.include?("raspberry")
|
42
44
|
return get_rasp_id if platform.include?("raspberry 2")
|
43
45
|
return get_mac_id if platform.include?("mac")
|
@@ -63,8 +65,9 @@ module Hwid
|
|
63
65
|
puts "running windows linux sigh"
|
64
66
|
res=run_cmd("lshw -quiet -class network -disable usb -disable spd | grep -oP '(serial: )\\K.*'")
|
65
67
|
res=res.gsub("0000-","")
|
66
|
-
res=res.
|
68
|
+
res=res.gsub(":","")
|
67
69
|
res=res.gsub("\n","")
|
70
|
+
res=res.gsub(" ","")
|
68
71
|
#res=run_cmd("lshw | grep -A 10 '*-cpu' | grep -oP '(serial: )\\K.*'")
|
69
72
|
#puts "Interim result is #{res.inspect}"
|
70
73
|
res=res.chomp
|