1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added agent scripttask, updated PT-BR translation.

This commit is contained in:
Ylian Saint-Hilaire 2021-08-21 08:38:09 -07:00
parent 92b9dd38e9
commit ecac7e2711
6 changed files with 785 additions and 313 deletions

View file

@ -639,6 +639,9 @@ function getIpLocationDataEx(func) {
catch (e) { return false; }
}
// Setup script task. Allows running scripts at scheduled intervals
var scriptTask = require('scripttask');
// Remove all Gateway MAC addresses for interface list. This is useful because the gateway MAC is not always populated reliably.
function clearGatewayMac(str) {
if (typeof str != 'string') return null;
@ -2925,7 +2928,7 @@ function processConsoleCommand(cmd, args, rights, sessionid) {
var response = null;
switch (cmd) {
case 'help': { // Displays available commands
var fin = '', f = '', availcommands = 'agentupdate,errorlog,msh,timerinfo,coreinfo,coredump,service,fdsnapshot,fdcount,startupoptions,alert,agentsize,versions,help,info,osinfo,args,print,type,dbkeys,dbget,dbset,dbcompact,eval,parseuri,httpget,wslist,plugin,wsconnect,wssend,wsclose,notify,ls,ps,kill,netinfo,location,power,wakeonlan,setdebug,smbios,rawsmbios,toast,lock,users,openurl,getscript,getclip,setclip,log,av,cpuinfo,sysinfo,apf,scanwifi,wallpaper,agentmsg';
var fin = '', f = '', availcommands = 'agentupdate,errorlog,msh,timerinfo,coreinfo,coredump,service,fdsnapshot,fdcount,startupoptions,alert,agentsize,versions,help,info,osinfo,args,print,type,dbkeys,dbget,dbset,dbcompact,eval,parseuri,httpget,wslist,plugin,wsconnect,wssend,wsclose,notify,ls,ps,kill,netinfo,location,power,wakeonlan,setdebug,smbios,rawsmbios,toast,lock,users,openurl,getscript,getclip,setclip,log,av,cpuinfo,sysinfo,apf,scanwifi,wallpaper,agentmsg,task';
if (require('os').dns != null) { availcommands += ',dnsinfo'; }
try { require('linux-dhcp'); availcommands += ',dhcp'; } catch (e) { }
if (process.platform == 'win32') { availcommands += ',cs,safemode,wpfhwacceleration,uac'; }
@ -4095,6 +4098,14 @@ function processConsoleCommand(cmd, args, rights, sessionid) {
}
break;
}
case 'task': {
if (!scriptTask) { response = "Tasks are not supported on this agent"; }
else {
if (args['_'][0]) { args.cmd = args['_'][0].toLowerCase(); }
response = scriptTask.processCommand(args, rights, sessionid);
}
break;
}
case 'plugin': {
if (typeof args['_'][0] == 'string') {
try {