1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-23 03:33:35 +00:00

Updated NetInfo, so desc is omitted if it's blank (MacOS/FreeBSD). Updated os.networkInterfaces() for FreeBSD

This commit is contained in:
Bryan Roe
2019-06-25 23:39:35 -07:00
parent 29efb10ce6
commit 424720211d
2 changed files with 3 additions and 2 deletions

View File

@@ -1582,7 +1582,8 @@ duk_ret_t ILibDuktape_MeshAgent_NetInfo(duk_context *ctx)
{\ {\
if(ni[tmp[0]][i].family == 'IPv4')\ if(ni[tmp[0]][i].family == 'IPv4')\
{\ {\
var ret = {v4addr: ni[tmp[0]][i].address, v4mask: ni[tmp[0]][i].netmask, mac: ni[tmp[0]][i].mac.split(':').join(''), gatewaymac: tmp[1], name: tmp[0], desc: dvname};\ var ret = {v4addr: ni[tmp[0]][i].address, v4mask: ni[tmp[0]][i].netmask, mac: ni[tmp[0]][i].mac.split(':').join(''), gatewaymac: tmp[1], name: tmp[0]};\
if(dvname != '') {ret['desc'] = dvname;}\
return({netif: {0: ret}});\ return({netif: {0: ret}});\
}\ }\
}\ }\

View File

@@ -1816,7 +1816,7 @@ void ILibDuktape_ScriptContainer_OS_Push(duk_context *ctx, void *chain)
return(defaultGateways);\ return(defaultGateways);\
}\ }\
}\ }\
if(process.platform == 'darwin')\ if(process.platform == 'darwin' || process.platform == 'freebsd')\
{\ {\
exports.networkInterfaces = function()\ exports.networkInterfaces = function()\
{\ {\