Merge pull request #95 from freifunk-gluon/config-mode-skip

gluon-setup-mode: allow skipping on first boot
This commit is contained in:
NeoRaider 2015-01-24 11:12:19 +01:00
commit 12304fcb4c
3 changed files with 23 additions and 0 deletions

View File

@ -35,4 +35,9 @@ define Package/gluon-setup-mode/install
$(CP) ./files/* $(1)/
endef
define Package/gluon-setup-mode/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-setup-mode))

View File

@ -0,0 +1,2 @@
need_boolean('setup_mode.skip', false)

View File

@ -0,0 +1,16 @@
#!/usr/bin/lua
local site = require 'gluon.site_config'
local uci = require 'luci.model.uci'
local c = uci.cursor()
if site.setup_mode
and site.setup_mode.skip
and not c:get_first('gluon-setup-mode', 'setup_mode', 'configured', false) then
local name = c:get_first("gluon-setup-mode", "setup_mode")
c:set("gluon-setup-mode", name, "configured", 1)
c:save('gluon-setup-mode')
c:commit('gluon-setup-mode')
end