Skip to content

Commit

Permalink
Merge pull request #338 from prey/linux-device-type
Browse files Browse the repository at this point in the history
'Other' device type fix for linux
  • Loading branch information
javo authored Oct 31, 2017
2 parents aa8c1d2 + f96d091 commit b7f4e9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

**Merged pull requests:**

- Device type fix for linux [\#338](https://github.com/prey/prey-node-client/pull/338) ([javo](https://github.com/javo))
- Prey user watcher for mac [\#332](https://github.com/prey/prey-node-client/pull/332) ([javo](https://github.com/javo))
- Ubuntu fixed hardware info [\#334](https://github.com/prey/prey-node-client/pull/334) ([javo](https://github.com/javo))
- Over 10 MB files wipe error fix [\#335](https://github.com/prey/prey-node-client/pull/335) ([javo](https://github.com/javo))
Expand Down
7 changes: 6 additions & 1 deletion lib/agent/providers/hardware/linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var data_fields = {
}
};

var valid_types = ['Desktop', 'Laptop', 'Tablet'];

exports.get_firmware_info = function(callback) {

var get_value = function(output, string) {
Expand All @@ -48,8 +50,11 @@ exports.get_firmware_info = function(callback) {

Object.keys(fields).map(function(key) {
var val = get_value(stdout, fields[key]);
if (val)
if (val) {
if (key == 'device_type' && valid_types.indexOf(val) == -1)
val = 'Laptop';
data[key] = val.trim();
}
});

done();
Expand Down

0 comments on commit b7f4e9f

Please sign in to comment.