mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-03 15:20:06 -05:00
Added dump command to console
This commit is contained in:
parent
d557054189
commit
d209eaa30e
@ -1812,6 +1812,39 @@ function createMeshCore(agent)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'dump':
|
||||||
|
if (args['_'].length < 1)
|
||||||
|
{
|
||||||
|
response = 'Proper usage: dump [on/off/status]'; // Display correct command usage
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch(args['_'][0].toLowerCase())
|
||||||
|
{
|
||||||
|
case 'on':
|
||||||
|
process.coreDumpLocation = process.platform == 'win32' ? process.execPath.replace('.exe', '.dmp') : (process.execPath + '.dmp');
|
||||||
|
response = 'enabled';
|
||||||
|
break;
|
||||||
|
case 'off':
|
||||||
|
process.coreDumpLocation = null;
|
||||||
|
response = 'disabled';
|
||||||
|
break;
|
||||||
|
case 'status':
|
||||||
|
if (process.coreDumpLocation)
|
||||||
|
{
|
||||||
|
response = 'Core Dump: [ENABLED' + (require('fs').existsSync(process.coreDumpLocation) ? (', (DMP file exists)]') : (']'));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
response = 'Core Dump: [DISABLED]';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
response = 'Proper usage: dump [on/off/status]'; // Display correct command usage
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'eval': { // Eval JavaScript
|
case 'eval': { // Eval JavaScript
|
||||||
if (args['_'].length < 1) {
|
if (args['_'].length < 1) {
|
||||||
response = 'Proper usage: eval "JavaScript code"'; // Display correct command usage
|
response = 'Proper usage: eval "JavaScript code"'; // Display correct command usage
|
||||||
|
33
agents/meshcore.min.js
vendored
33
agents/meshcore.min.js
vendored
@ -1812,6 +1812,39 @@ function createMeshCore(agent)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'dump':
|
||||||
|
if (args['_'].length < 1)
|
||||||
|
{
|
||||||
|
response = 'Proper usage: dump [on/off/status]'; // Display correct command usage
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch(args['_'][0].toLowerCase())
|
||||||
|
{
|
||||||
|
case 'on':
|
||||||
|
process.coreDumpLocation = process.platform == 'win32' ? process.execPath.replace('.exe', '.dmp') : (process.execPath + '.dmp');
|
||||||
|
response = 'enabled';
|
||||||
|
break;
|
||||||
|
case 'off':
|
||||||
|
process.coreDumpLocation = null;
|
||||||
|
response = 'disabled';
|
||||||
|
break;
|
||||||
|
case 'status':
|
||||||
|
if (process.coreDumpLocation)
|
||||||
|
{
|
||||||
|
response = 'Core Dump: [ENABLED' + (require('fs').existsSync(process.coreDumpLocation) ? (', (DMP file exists)]') : (']'));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
response = 'Core Dump: [DISABLED]';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
response = 'Proper usage: dump [on/off/status]'; // Display correct command usage
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'eval': { // Eval JavaScript
|
case 'eval': { // Eval JavaScript
|
||||||
if (args['_'].length < 1) {
|
if (args['_'].length < 1) {
|
||||||
response = 'Proper usage: eval "JavaScript code"'; // Display correct command usage
|
response = 'Proper usage: eval "JavaScript code"'; // Display correct command usage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user