mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 11:01:52 +00:00
Added AMT on, off, reset power commands to meshctrl.js, #4038
This commit is contained in:
parent
876562682e
commit
92dac1df8b
2 changed files with 13 additions and 0 deletions
|
@ -955,6 +955,7 @@ module.exports.CreateAmtManager = function (parent) {
|
||||||
// If not LMS, has a AMT stack present and is in connected state, perform power operation.
|
// If not LMS, has a AMT stack present and is in connected state, perform power operation.
|
||||||
if ((dev.connType != 2) && (dev.state == 1) && (dev.amtstack != null)) {
|
if ((dev.connType != 2) && (dev.state == 1) && (dev.amtstack != null)) {
|
||||||
// Action: 2 = Power on, 8 = Power down, 10 = reset
|
// Action: 2 = Power on, 8 = Power down, 10 = reset
|
||||||
|
parent.debug('amt', dev.name, "performPowerAction", action);
|
||||||
dev.powerAction = action;
|
dev.powerAction = action;
|
||||||
try { dev.amtstack.RequestPowerStateChange(action, performPowerActionResponse); } catch (ex) { }
|
try { dev.amtstack.RequestPowerStateChange(action, performPowerActionResponse); } catch (ex) { }
|
||||||
}
|
}
|
||||||
|
|
12
meshctrl.js
12
meshctrl.js
|
@ -839,6 +839,9 @@ if (args['_'].length == 0) {
|
||||||
console.log(" --reset - Attempt to remote the remote device.");
|
console.log(" --reset - Attempt to remote the remote device.");
|
||||||
console.log(" --sleep - Attempt to place the remote device in low power mode.");
|
console.log(" --sleep - Attempt to place the remote device in low power mode.");
|
||||||
console.log(" --off - Attempt to power off the remote device.");
|
console.log(" --off - Attempt to power off the remote device.");
|
||||||
|
console.log(" --amtoff - Attempt to power off the remote device using Intel AMT.");
|
||||||
|
console.log(" --amton - Attempt to power on the remote device using Intel AMT.");
|
||||||
|
console.log(" --amtreset - Attempt to reset the remote device using Intel AMT.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'devicesharing': {
|
case 'devicesharing': {
|
||||||
|
@ -1520,6 +1523,15 @@ function serverConnect() {
|
||||||
} else if (args.sleep) {
|
} else if (args.sleep) {
|
||||||
// Sleep operation
|
// Sleep operation
|
||||||
ws.send(JSON.stringify({ action: 'poweraction', nodeids: nodes, actiontype: 4, responseid: 'meshctrl' }));
|
ws.send(JSON.stringify({ action: 'poweraction', nodeids: nodes, actiontype: 4, responseid: 'meshctrl' }));
|
||||||
|
} else if (args.amton) {
|
||||||
|
// Intel AMT Power on operation
|
||||||
|
ws.send(JSON.stringify({ action: 'poweraction', nodeids: nodes, actiontype: 302, responseid: 'meshctrl' }));
|
||||||
|
} else if (args.amtoff) {
|
||||||
|
// Intel AMT Power off operation
|
||||||
|
ws.send(JSON.stringify({ action: 'poweraction', nodeids: nodes, actiontype: 308, responseid: 'meshctrl' }));
|
||||||
|
} else if (args.amtreset) {
|
||||||
|
// Intel AMT Power reset operation
|
||||||
|
ws.send(JSON.stringify({ action: 'poweraction', nodeids: nodes, actiontype: 310, responseid: 'meshctrl' }));
|
||||||
} else {
|
} else {
|
||||||
console.log('No power operation specified.');
|
console.log('No power operation specified.');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|
Loading…
Reference in a new issue