mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-25 04:19:11 -05:00
Add --iderstart as an option to amtider
Allows you to change when the IDER session begins, either `onreboot`, `graceful` or `now`
This commit is contained in:
parent
4787df172b
commit
d8cb4d10e4
@ -153,6 +153,7 @@ function run(argv) {
|
|||||||
if ((typeof args.scan) == 'string') { settings.scan = args.scan; }
|
if ((typeof args.scan) == 'string') { settings.scan = args.scan; }
|
||||||
if ((typeof args.token) == 'string') { settings.token = args.token; }
|
if ((typeof args.token) == 'string') { settings.token = args.token; }
|
||||||
if ((typeof args.timeout) == 'string') { settings.timeout = parseInt(args.timeout); }
|
if ((typeof args.timeout) == 'string') { settings.timeout = parseInt(args.timeout); }
|
||||||
|
if ((typeof args.iderstart) == 'string') { settings.iderstart = args.iderstart; }
|
||||||
if ((typeof args.uuidoutput) == 'string' || args.uuidoutput) { settings.uuidoutput = args.uuidoutput; }
|
if ((typeof args.uuidoutput) == 'string' || args.uuidoutput) { settings.uuidoutput = args.uuidoutput; }
|
||||||
if ((typeof args.desc) == 'string') { settings.desc = args.desc; }
|
if ((typeof args.desc) == 'string') { settings.desc = args.desc; }
|
||||||
if ((typeof args.dnssuffix) == 'string') { settings.dnssuffix = args.dnssuffix; }
|
if ((typeof args.dnssuffix) == 'string') { settings.dnssuffix = args.dnssuffix; }
|
||||||
@ -364,6 +365,7 @@ function run(argv) {
|
|||||||
console.log(' --floppy [file] Specifies .img file to be mounted as a flppy disk.');
|
console.log(' --floppy [file] Specifies .img file to be mounted as a flppy disk.');
|
||||||
console.log(' --cdrom [file] Specifies .img file to be mounted as a CDROM disk.');
|
console.log(' --cdrom [file] Specifies .img file to be mounted as a CDROM disk.');
|
||||||
console.log(' --timeout [seconds] Optional, disconnect after number of seconds without disk read.');
|
console.log(' --timeout [seconds] Optional, disconnect after number of seconds without disk read.');
|
||||||
|
console.log(' --iderstart [onreboot|graceful|now] Optional, when to start the IDER session.');
|
||||||
} else if (action == 'amtscan') {
|
} else if (action == 'amtscan') {
|
||||||
console.log('AmtSCAN will look for Intel AMT device on the network. Example usage:\r\n\r\n meshcmd amtscan --scan 192.168.1.0/24');
|
console.log('AmtSCAN will look for Intel AMT device on the network. Example usage:\r\n\r\n meshcmd amtscan --scan 192.168.1.0/24');
|
||||||
console.log('\r\Required arguments:\r\n');
|
console.log('\r\Required arguments:\r\n');
|
||||||
@ -862,7 +864,6 @@ function run(argv) {
|
|||||||
if (args.bootindex && args.bootindex >=0) {
|
if (args.bootindex && args.bootindex >=0) {
|
||||||
settings.bootindex = args.bootindex;
|
settings.bootindex = args.bootindex;
|
||||||
}
|
}
|
||||||
|
|
||||||
performAmtPowerAction();
|
performAmtPowerAction();
|
||||||
} else {
|
} else {
|
||||||
console.log('Invalid "action" specified.'); exit(1); return;
|
console.log('Invalid "action" specified.'); exit(1); return;
|
||||||
@ -2291,6 +2292,8 @@ iderIdleTimer = null;
|
|||||||
function performIder() {
|
function performIder() {
|
||||||
if ((settings.floppy != null) && fs.existsSync(settings.floppy) == false) { console.log("Unable to floppy image file: " + settings.floppy); exit(); return; }
|
if ((settings.floppy != null) && fs.existsSync(settings.floppy) == false) { console.log("Unable to floppy image file: " + settings.floppy); exit(); return; }
|
||||||
if ((settings.cdrom != null) && fs.existsSync(settings.cdrom) == false) { console.log("Unable to CDROM image file: " + settings.cdrom); exit(); return; }
|
if ((settings.cdrom != null) && fs.existsSync(settings.cdrom) == false) { console.log("Unable to CDROM image file: " + settings.cdrom); exit(); return; }
|
||||||
|
var iderStarts = ['onreboot', 'graceful', 'now'];
|
||||||
|
if ((settings.iderstart != null) && iderStarts.indexOf(settings.iderstart) < 0) { console.log("Unknown iderstart option: " + settings.iderstart); exit(); return; }
|
||||||
try {
|
try {
|
||||||
var sfloppy = null, scdrom = null;
|
var sfloppy = null, scdrom = null;
|
||||||
if (settings.floppy) { try { if (sfloppy = fs.statSync(settings.floppy)) { sfloppy.file = fs.openSync(settings.floppy, 'rbN'); } } catch (ex) { console.log(ex); exit(1); return; } }
|
if (settings.floppy) { try { if (sfloppy = fs.statSync(settings.floppy)) { sfloppy.file = fs.openSync(settings.floppy, 'rbN'); } } catch (ex) { console.log(ex); exit(1); return; } }
|
||||||
@ -2300,7 +2303,11 @@ function performIder() {
|
|||||||
ider.onStateChanged = onIderStateChange;
|
ider.onStateChanged = onIderStateChange;
|
||||||
ider.m.floppy = sfloppy;
|
ider.m.floppy = sfloppy;
|
||||||
ider.m.cdrom = scdrom;
|
ider.m.cdrom = scdrom;
|
||||||
|
if (settings.iderstart) {
|
||||||
|
ider.m.iderStart = iderStarts.indexOf(settings.iderstart);
|
||||||
|
} else {
|
||||||
ider.m.iderStart = 1; // OnReboot = 0, Graceful = 1, Now = 2
|
ider.m.iderStart = 1; // OnReboot = 0, Graceful = 1, Now = 2
|
||||||
|
}
|
||||||
ider.m.debug = (settings.debuglevel > 0);
|
ider.m.debug = (settings.debuglevel > 0);
|
||||||
if (settings.timeout > 0) {
|
if (settings.timeout > 0) {
|
||||||
ider.m.sectorStats = iderSectorStats;
|
ider.m.sectorStats = iderSectorStats;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user