From 8dc3be61998f55045e475f76a3306adaeaaa53b9 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Fri, 13 Dec 2013 14:23:31 +0100 Subject: [PATCH] Log firmware version in wifibox.log --- src/main.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.lua b/src/main.lua index 7649424..a92bed6 100644 --- a/src/main.lua +++ b/src/main.lua @@ -1,4 +1,4 @@ ---- +---- -- Entry code of the REST API and secondary functionality. -- Primarily, this sets up the environment, processes a REST request and responds appropiately. -- Secondary functions are to auto-switch between access point and client (@{setupAutoWifiMode}) @@ -15,6 +15,12 @@ local RequestClass = require('rest.request') local ResponseClass = require('rest.response') local Signin = require('network.signin') +-- NOTE: the updater module 'detects' command-line invocation by existence of 'arg', so we have to make sure it is not defined. +argStash = arg +arg = nil +local updater = require('script.d3d-updater') +arg = argStash + local postData = nil @@ -185,6 +191,10 @@ local function main(environment) local rq = RequestClass.new(environment, postData, confDefaults.DEBUG_API) if rq:getRequestMethod() == 'CMDLINE' and rq:get('autowifi') ~= nil then + + local version = updater.formatVersion(updater.getCurrentVersion()); + log:info("Doodle3D version: "..util.dump(version)) + log:info("running in autowifi mode") local rv,msg = setupAutoWifiMode()