fix coreinfo and sendPeriodicServerUpdate
Signed-off-by: si458 <simonsmith5521@gmail.com>
si458 committed
Jan 29, 2024 at 15:13 UTC
97ed6c82859bca0f89ec3077bc40e110e3a359e6
1 file changed
+12
-12
agents/meshcore.js
+12
-12
@@ -3798,7 +3798,7 @@ function processConsoleCommand(cmd, args, rights, sessionid) {
3798
var response = null;
3799
switch (cmd) {
3800
case 'help': { // Displays available commands
3801
- var fin = '', f = '', availcommands = 'domain,translations,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,uninstallagent,display';
3801
+ var fin = '', f = '', availcommands = 'domain,translations,agentupdate,errorlog,msh,timerinfo,coreinfo,coreinfoupdate,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,uninstallagent,display';
3802
if (require('os').dns != null) { availcommands += ',dnsinfo'; }
3803
try { require('linux-dhcp'); availcommands += ',dhcp'; } catch (ex) { }
3804
if (process.platform == 'win32') {
@@ -4143,7 +4143,8 @@ function processConsoleCommand(cmd, args, rights, sessionid) {
4143
break;
4144
}
4145
case 'coreinfoupdate': {
4146
- sendPeriodicServerUpdate();
4146
+ sendPeriodicServerUpdate(null, true);
4147
+ response = "Core Info Update Requested"
4148
break;
4149
}
4150
case 'agentmsg': {
@@ -5669,6 +5670,7 @@ function sendNetworkUpdate(force) {
5670
function sendPeriodicServerUpdate(flags, force) {
5671
if (meshServerConnectionState == 0) return; // Not connected to server, do nothing.
5672
if (!flags) { flags = 0xFFFFFFFF; }
5673
+ if (!force) { force = false; }
5674
5675
// If we have a connected MEI, get Intel ME information
5676
if ((flags & 1) && (amt != null) && (amt.state == 2)) {
@@ -5711,17 +5713,15 @@ function sendPeriodicServerUpdate(flags, force) {
5713
} catch (ex){ }
5714
// Get Volumes and BitLocker if Windows
5715
try {
5714
- if (process.platform == 'win32'){
5715
- if (require('computer-identifiers').volumes_promise != null){
5716
- var p = require('computer-identifiers').volumes_promise();
5717
- p.then(function (res){
5718
- meshCoreObj.volumes = res;
5719
- meshCoreObjChanged();
5720
- });
5721
- }else if (require('computer-identifiers').volumes != null){
5722
- meshCoreObj.volumes = require('computer-identifiers').volumes();
5716
+ if (require('computer-identifiers').volumes_promise != null){
5717
+ var p = require('computer-identifiers').volumes_promise();
5718
+ p.then(function (res){
5719
+ meshCoreObj.volumes = res;
5720
meshCoreObjChanged();
5724
- }
5721
+ });
5722
+ }else if (require('computer-identifiers').volumes != null){
5723
+ meshCoreObj.volumes = require('computer-identifiers').volumes();
5724
+ meshCoreObjChanged();
5725
}
5726
} catch(e) { }
5727
}