diff --git a/files/www/cgi-bin/sysinfo.json b/files/www/cgi-bin/sysinfo.json index 1fd02d1e..39b9f547 100755 --- a/files/www/cgi-bin/sysinfo.json +++ b/files/www/cgi-bin/sysinfo.json @@ -84,11 +84,16 @@ info['node_details']['firmware_mfg']=fw_mfg info['node_details']['firmware_version']=getFirmwareVersion() -- Mesh RF info -info["meshrf"]={} -info["meshrf"]["ssid"]=getSSID() +info['meshrf']={} local radio=getMeshRadioDevice() -info["meshrf"]["channel"]=getChannel(radio) -info["meshrf"]['chanbw']=getChannelBW(radio) +if ( radio ~= nill and radio ~= "" ) then + info['meshrf']['status']="on" + info['meshrf']['ssid']=getSSID() + info['meshrf']['channel']=getChannel(radio) + info['meshrf']['chanbw']=getChannelBW(radio) +else + info['meshrf']['status']="off" +end -- Tunnel info info['tunnels']={} @@ -97,11 +102,11 @@ local tunnel_installed=false if file_exists("/usr/sbin/vtund") then tunnel_installed="true" end -info['tunnels']["tunnel_installed"]=tunnel_installed +info['tunnels']['tunnel_installed']=tunnel_installed -- ACTIVE TUNNELS local atc="" atc=os.capture("ifconfig|grep tun|wc -l") -info['tunnels']["active_tunnel_count"]=atc:chomp() +info['tunnels']['active_tunnel_count']=atc:chomp() -- Location info -- LAT/LON @@ -110,7 +115,7 @@ info['lat']=lat info['lon']=lon -- GRID SQUARE -info["grid_square"]=getGridSquare() +info['grid_square']=getGridSquare() -- UPTIME AND LOADAVGS mynix=nixio.sysinfo() @@ -140,7 +145,7 @@ for pos, i in pairs(ift) do table.insert(tif,nim) end end -info["interfaces"]=tif +info['interfaces']=tif -- HOSTS if string.find(nixio.getenv("QUERY_STRING"):lower(),"hosts=1") then @@ -177,7 +182,7 @@ if string.find(nixio.getenv("QUERY_STRING"):lower(),"hosts=1") then host['error']="Cannot read hosts file" table.insert(hosts,host) end - info["hosts"]=hosts + info['hosts']=hosts end -- SERVICES @@ -205,7 +210,7 @@ if string.find(nixio.getenv("QUERY_STRING"):lower(),"services=1") then service['error']="Cannot read services file" table.insert(services,service) end - info["services"]=services + info['services']=services end -- LOCALLY HOSTED SERVICES ONLY