mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-25 06:35:54 -05:00
Added --hex option to MeshCtrl.js listdevicegroups.
This commit is contained in:
parent
566897fd9a
commit
b9aed71a5c
@ -252,6 +252,7 @@ if (args['_'].length == 0) {
|
||||
console.log(" --idexists [id] - Return 1 if id exists, 0 if not.");
|
||||
console.log(" --nameexists [name] - Return id if name exists.");
|
||||
console.log(" --emailexists [email] - Return id if email exists.");
|
||||
console.log(" --hex - Display meshid in hex format.");
|
||||
console.log(" --json - Show result as JSON.");
|
||||
break;
|
||||
}
|
||||
@ -1020,7 +1021,9 @@ function serverConnect() {
|
||||
console.log('id, name\r\n---------------');
|
||||
for (var i in data.meshes) {
|
||||
const m = data.meshes[i];
|
||||
var t = "\"" + m._id.split('/')[2] + "\", \"" + m.name + "\"";
|
||||
var mid = m._id.split('/')[2];
|
||||
if (args.hex) { mid = Buffer.from(mid.replace(/\@/g, '+').replace(/\$/g, '/'), 'base64').toString('hex').toUpperCase(); }
|
||||
var t = "\"" + mid + "\", \"" + m.name + "\"";
|
||||
console.log(t);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user