From a68f7571e7f2407a4200b2fca435ec7a534fb803 Mon Sep 17 00:00:00 2001 From: ollo Date: Tue, 3 Jan 2017 13:38:56 +0100 Subject: [PATCH] Stop parsing, when reboot is triggered --- webserver.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webserver.lua b/webserver.lua index a24141f..547c045 100644 --- a/webserver.lua +++ b/webserver.lua @@ -145,6 +145,7 @@ function startWebServer() --- Do the magic! if (_POST.action ~= nil and _POST.action == "Reboot") then node.restart() + return end if ((_POST.ssid~=nil) and (_POST.sntpserver~=nil) and (_POST.timezoneoffset~=nil)) then @@ -197,9 +198,11 @@ function startWebServer() local blue = tonumber(string.sub(hexColor, 5, 6), 16) file.write("color4=string.char(" .. green .. "," .. red .. "," .. blue .. ")\n") end - time = getTime(sec, timezoneoffset) file.write("color=string.char(" .. string.byte(color,1) .. "," .. string.byte(color, 2) .. "," .. string.byte(color, 3) .. ")\n") - file.write("print(\"Config from " .. time.year .. "-" .. time.month .. "-" .. time.day .. " " .. time.hour .. ":" .. time.minute .. ":" .. time.second .. "\")\n") + if (getTime ~= nil) then + time = getTime(sec, timezoneoffset) + file.write("print(\"Config from " .. time.year .. "-" .. time.month .. "-" .. time.day .. " " .. time.hour .. ":" .. time.minute .. ":" .. time.second .. "\")\n") + end if (_POST.threequater ~= nil) then file.write("threequater=true\n") else