hwid 0.3.5 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/hwid.rb +1 -1
- data/lib/hwid.rb +1 -1
- data/lib/hwid/base.rb +17 -1
- 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: 0cb3bf633548d93535b3a554aace9057ddd3cb9ed1e5484a152fe5190d4d2ade
|
4
|
+
data.tar.gz: 28446f39bbb19c5ab0bbdff17e1159a4ad1a08549dd90ef36cf5c33dbf1188f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9210faac3bb9d089dda264736ad52706be7d123a168d764d308910951be2658059ba8229d53c99b204d84aae9b9ab744ae9203eb69212aa59d969bc8aa5852f2
|
7
|
+
data.tar.gz: 4030153236dea31bda129bfff3ed44f5903938722a733403d3e64b97ae626126a77a28f127c9d85a210512ace7c4671b1f017b07bc5ac9c7711d43dd83e76160
|
data/bin/hwid.rb
CHANGED
data/lib/hwid.rb
CHANGED
data/lib/hwid/base.rb
CHANGED
@@ -29,6 +29,7 @@ module Hwid
|
|
29
29
|
platform << "arm" if (/arm/ =~ RUBY_PLATFORM) != nil
|
30
30
|
platform << "x86" if (/x86/ =~ RUBY_PLATFORM) != nil
|
31
31
|
platform << "i686" if (/i686/ =~ RUBY_PLATFORM) != nil
|
32
|
+
platform << "microsoft" if `uname -a`.include?('Microsoft')
|
32
33
|
platform << "debian" if `uname -a`.include?('Debian')
|
33
34
|
platform << "ubuntu" if `uname -a`.include?('Ubuntu')
|
34
35
|
platform << "linux" if (/linux/ =~ RUBY_PLATFORM) != nil
|
@@ -36,10 +37,11 @@ module Hwid
|
|
36
37
|
end
|
37
38
|
def systemid
|
38
39
|
platform=get_platform
|
39
|
-
|
40
|
+
puts "debug: platform is #{platform} #{RUBY_PLATFORM}"
|
40
41
|
return get_rasp_id if platform.include?("raspberry")
|
41
42
|
return get_rasp_id if platform.include?("raspberry 2")
|
42
43
|
return get_mac_id if platform.include?("mac")
|
44
|
+
return get_windows_id if platform.include?("microsoft")
|
43
45
|
return get_linuxdebian_id if platform.include?("debian") #virtaul box ??
|
44
46
|
return get_linuxdebian_id if platform.include?("ubuntu") #virtaul box ??
|
45
47
|
return get_linux_id if platform.include?("linux")
|
@@ -57,6 +59,20 @@ module Hwid
|
|
57
59
|
res=run_cmd('grep Serial /proc/cpuinfo')
|
58
60
|
self.parse(res)
|
59
61
|
end
|
62
|
+
def get_windows_id
|
63
|
+
puts "running windows linux sigh"
|
64
|
+
res=run_cmd("lshw -quiet -class network -disable usb -disable spd | grep -oP '(serial: )\\K.*'")
|
65
|
+
res=res.gsub("0000-","")
|
66
|
+
res=res.gsub(":","")
|
67
|
+
res=res.gsub("\n","")
|
68
|
+
res=res.gsub(" ","")
|
69
|
+
#res=run_cmd("lshw | grep -A 10 '*-cpu' | grep -oP '(serial: )\\K.*'")
|
70
|
+
#puts "Interim result is #{res.inspect}"
|
71
|
+
res=res.chomp
|
72
|
+
puts "windows command result: #{res}"
|
73
|
+
res
|
74
|
+
end
|
75
|
+
|
60
76
|
def get_mac_id
|
61
77
|
res=run_cmd('/usr/sbin/system_profiler SPHardwareDataType -timeout 5 | grep Serial')
|
62
78
|
self.parse(res)
|