Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Other' device type fix for linux #338

Merged
merged 2 commits into from
Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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