mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-24 22:25:52 -05:00
Added dump command to console
This commit is contained in:
parent
452d190d37
commit
668f496dc9
@ -1812,6 +1812,39 @@ function createMeshCore(agent)
|
||||
}
|
||||
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
|
||||
if (args['_'].length < 1) {
|
||||
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;
|
||||
}
|
||||
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
|
||||
if (args['_'].length < 1) {
|
||||
response = 'Proper usage: eval "JavaScript code"'; // Display correct command usage
|
||||
|
Loading…
Reference in New Issue
Block a user