Skip to content
Snippets Groups Projects
Commit 62940936 authored by Nils Schneider's avatar Nils Schneider
Browse files

gluon-setup-mode: allow skipping on first boot

By setting setup_mode.skip to true in site.conf the device will skip
setup mode on first boot.
parent 8e33dd50
No related branches found
No related tags found
No related merge requests found
......@@ -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))
need_boolean('setup_mode.skip', false)
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment