From b0bc20b3922062973b5c338fe93dfe9dc9aab48b Mon Sep 17 00:00:00 2001 From: dman776 Date: Sat, 11 May 2019 12:08:37 -0500 Subject: [PATCH] api: add first_boot field to indicate if this node has been configured or not (#416) --- files/usr/lib/lua/aredn/info.lua | 8 ++++++++ files/www/cgi-bin/api | 1 + 2 files changed, 9 insertions(+) diff --git a/files/usr/lib/lua/aredn/info.lua b/files/usr/lib/lua/aredn/info.lua index d5fd85be..2c68e000 100755 --- a/files/usr/lib/lua/aredn/info.lua +++ b/files/usr/lib/lua/aredn/info.lua @@ -49,6 +49,14 @@ require("iwinfo") ------------------------------------- local model = {} + +------------------------------------- +-- Get FIRST_BOOT status +------------------------------------- +function model.getFirstBoot() + return (model.getNodeName()=="NOCALL") +end + ------------------------------------- -- Returns WAN Address ------------------------------------- diff --git a/files/www/cgi-bin/api b/files/www/cgi-bin/api index 1bb50e10..22b8cf83 100755 --- a/files/www/cgi-bin/api +++ b/files/www/cgi-bin/api @@ -60,6 +60,7 @@ function getSysinfo() -- info['uptime']=aredn_info.getUptime() info['loads']=aredn_info.getLoads() + info['first_boot']=aredn_info.getFirstBoot() return info end