gluon-config-mode: rename config-mode to gluon-config-mode

This commit is contained in:
Nils Schneider 2013-10-02 22:56:19 +02:00
parent 38e09f3eae
commit 9d41be9ddd
8 changed files with 24 additions and 24 deletions

View File

@ -21,13 +21,13 @@ check_enable() {
start() {
enable=0
config_load config-mode
config_load gluon-config-mode
config_foreach check_enable wizard
if [ "$enable" = '1' ]; then
lua -luci -e 'require "luci.model.uci"; uci_state=luci.model.uci.cursor_state(); uci_state:section("config-mode", "wizard", nil, { running = "1" }); uci_state:save("config-mode")'
uci set 'config-mode.@wizard[0].enabled=0'
uci commit config-mode
lua -luci -e 'require "luci.model.uci"; uci_state=luci.model.uci.cursor_state(); uci_state:section("gluon-config-mode", "wizard", nil, { running = "1" }); uci_state:save("gluon-config-mode")'
uci set 'gluon-config-mode.@wizard[0].enabled=0'
uci commit gluon-config-mode
ip addr add $config_mode_addr/$config_mode_plen dev $config_mode_iface
ip link set up dev $config_mode_iface
@ -41,8 +41,8 @@ start() {
# correctly finish firstboot
/etc/init.d/done boot
echo "$config_mode_addr $config_mode_dnsname" > /tmp/hosts.config-mode
dnsmasq -h -H /tmp/hosts.config-mode -R -F interface:$config_mode_iface,$config_mode_dhcp_range -l /tmp/dhcp.leases -O option:router
echo "$config_mode_addr $config_mode_dnsname" > /tmp/hosts.gluon-config-mode
dnsmasq -h -H /tmp/hosts.gluon-config-mode -R -F interface:$config_mode_iface,$config_mode_dhcp_range -l /tmp/dhcp.leases -O option:router
. /etc/diag.sh
get_status_led

View File

@ -1,6 +1,6 @@
#!/bin/sh
OLD_CFG=/etc/config/config_mode
NEW_CFG=/etc/config/config-mode
NEW_CFG=/etc/config/gluon-config-mode
[ -f $OLD_CFG ] && mv $OLD_CFG $NEW_CFG

View File

@ -10,54 +10,54 @@ You may obtain a copy of the License at
$Id$
]]--
module("luci.controller.config-mode.config-mode", package.seeall)
module("luci.controller.gluon-config-mode.index", package.seeall)
local meshvpn_name = "mesh_vpn"
function index()
local uci_state = luci.model.uci.cursor_state()
if uci_state:get_first("config-mode", "wizard", "running", "0") == "1" then
if uci_state:get_first("gluon-config-mode", "wizard", "running", "0") == "1" then
local root = node()
if not root.target then
root.target = alias("config-mode")
root.target = alias("gluon-config-mode")
root.index = true
end
page = node()
page.lock = true
page.target = alias("config-mode")
page.target = alias("gluon-config-mode")
page.subindex = true
page.index = false
page = node("config-mode")
page = node("gluon-config-mode")
page.title = _("Wizard")
page.target = alias("config-mode", "wizard")
page.target = alias("gluon-config-mode", "wizard")
page.order = 5
page.setuser = "root"
page.setgroup = "root"
page.index = true
entry({"config-mode", "wizard"}, form("config-mode/wizard")).index = true
entry({"config-mode", "reboot"}, call("action_reboot"))
entry({"gluon-config-mode", "wizard"}, form("gluon-config-mode/wizard")).index = true
entry({"gluon-config-mode", "reboot"}, call("action_reboot"))
end
end
function action_reboot()
local configmode = require "luci.tools.config-mode"
local configmode = require "luci.tools.gluon-config-mode"
local pubkey
local uci = luci.model.uci.cursor()
local meshvpn_enabled = uci:get("fastd", meshvpn_name, "enabled", "0")
if meshvpn_enabled == "1" then
pubkey = configmode.get_fastd_pubkey(meshvpn_name)
end
luci.template.render("config-mode/reboot", {pubkey=pubkey})
luci.template.render("gluon-config-mode/reboot", {pubkey=pubkey})
uci:foreach("config-mode", "wizard", function(s)
uci:set("config-mode", s[".name"], "configured", "1")
uci:foreach("gluon-config-mode", "wizard", function(s)
uci:set("gluon-config-mode", s[".name"], "configured", "1")
end)
uci:save("config-mode")
uci:commit("config-mode")
uci:save("gluon-config-mode")
uci:commit("gluon-config-mode")
luci.sys.reboot()
end

View File

@ -1,4 +1,4 @@
local configmode = require "luci.tools.config-mode"
local configmode = require "luci.tools.gluon-config-mode"
local meshvpn_name = "mesh_vpn"
local uci = luci.model.uci.cursor()
local f, s, o
@ -75,7 +75,7 @@ function f.handle(self, state, data)
uci:save("system")
uci:commit("system")
luci.http.redirect(luci.dispatcher.build_url("config-mode", "reboot"))
luci.http.redirect(luci.dispatcher.build_url("gluon-config-mode", "reboot"))
end
return true

View File

@ -1,7 +1,7 @@
local luci = require "luci"
local io = require "io"
module "luci.tools.config-mode"
module "luci.tools.gluon-config-mode"
function setup_fastd_secret(name)
local uci = luci.model.uci.cursor()