310-setup-mode-migrate 409 B

1234567891011121314151617
  1. #!/usr/bin/lua
  2. local site = require 'gluon.site_config'
  3. local uci = require 'luci.model.uci'
  4. local c = uci.cursor()
  5. local old = c:get_first('gluon-config-mode', 'wizard', 'configured')
  6. if old == '1' then
  7. local setup_mode = c:get_first('gluon-setup-mode', 'setup_mode')
  8. c:set('gluon-setup-mode', setup_mode, 'configured', '1')
  9. c:save('gluon-setup-mode')
  10. end
  11. os.remove('/etc/config/gluon-config-mode')