mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-09 21:49:43 -05:00
Switched to new style network information from agent.
This commit is contained in:
@@ -3045,15 +3045,10 @@ function createMeshCore(agent) {
|
||||
break;
|
||||
}
|
||||
case 'netinfo': { // Show network interface information
|
||||
//response = objToString(mesh.NetInfo, 0, ' ');
|
||||
var interfaces = require('os').networkInterfaces();
|
||||
response = objToString(interfaces, 0, ' ', true);
|
||||
break;
|
||||
}
|
||||
case 'netinfo2': { // Show network interface information
|
||||
response = objToString(mesh.NetInfo, 0, ' ', true);
|
||||
break;
|
||||
}
|
||||
case 'wakeonlan': { // Send wake-on-lan
|
||||
if ((args['_'].length != 1) || (args['_'][0].length != 12)) {
|
||||
response = 'Proper usage: wakeonlan [mac], for example "wakeonlan 010203040506".';
|
||||
@@ -3280,8 +3275,8 @@ function createMeshCore(agent) {
|
||||
sendNetworkUpdateNagleTimer = null;
|
||||
|
||||
// Update the network interfaces information data
|
||||
var netInfo = mesh.NetInfo;
|
||||
if (netInfo) {
|
||||
var netInfo = { netif2: require('os').networkInterfaces() };
|
||||
if (netInfo.netif2) {
|
||||
netInfo.action = 'netinfo';
|
||||
var netInfoStr = JSON.stringify(netInfo);
|
||||
if ((force == true) || (clearGatewayMac(netInfoStr) != clearGatewayMac(lastNetworkInfo))) { mesh.SendCommand(netInfo); lastNetworkInfo = netInfoStr; }
|
||||
|
||||
Reference in New Issue
Block a user