summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Vasile <james@jamesvasile.com>2013-02-09 15:40:30 -0500
committerJames Vasile <james@jamesvasile.com>2013-02-09 15:51:32 -0500
commita8c3a73013f3d86c75d60083d4142cd1fc25ca13 (patch)
treee7cd91084a9e6b90aa87af3205b7e3b1e6242e46
parentd1a4d8ec9f0edd784cfdf9eef71b304a070f7d3e (diff)
First boot hijacks root if needed
-rwxr-xr-xplinth.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/plinth.py b/plinth.py
index 1cf3019..7d285bc 100755
--- a/plinth.py
+++ b/plinth.py
@@ -53,9 +53,13 @@ def error_page_500(status, message, traceback, version):
class Root(plugin_mount.PagePlugin):
@cherrypy.expose
def index(self):
+ ## TODO: firstboot hijacking root should probably be in the firstboot module with a hook in plinth.py
with sqlite_db(cfg.store_file, table="firstboot") as db:
if not 'state' in db:
raise cherrypy.InternalRedirect('/firstboot')
+ elif db['state'] < 5:
+ cfg.log("First Boot state = %d" % db['state'])
+ raise cherrypy.InternalRedirect('/firstboot/state%d' % db['state'])
if cherrypy.session.get(cfg.session_key, None):
raise cherrypy.InternalRedirect('/router')
else: