mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-22 19:23:31 +00:00
Updated NetInfo, so desc is omitted if it's blank (MacOS/FreeBSD). Updated os.networkInterfaces() for FreeBSD
This commit is contained in:
@@ -1582,7 +1582,8 @@ duk_ret_t ILibDuktape_MeshAgent_NetInfo(duk_context *ctx)
|
||||
{\
|
||||
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}});\
|
||||
}\
|
||||
}\
|
||||
|
||||
@@ -1816,7 +1816,7 @@ void ILibDuktape_ScriptContainer_OS_Push(duk_context *ctx, void *chain)
|
||||
return(defaultGateways);\
|
||||
}\
|
||||
}\
|
||||
if(process.platform == 'darwin')\
|
||||
if(process.platform == 'darwin' || process.platform == 'freebsd')\
|
||||
{\
|
||||
exports.networkInterfaces = function()\
|
||||
{\
|
||||
|
||||
Reference in New Issue
Block a user