Adapt to new modular config mode, add new reboot-ffhh package

this makes the old ffhh specific config mode obsolte, as only
a package (reboot-ffhh) is need to add the necessary information
to the reboot page
This commit is contained in:
ohrensessel 2014-08-07 18:06:14 +02:00
commit 918d892f15
10 changed files with 59 additions and 358 deletions

View file

@ -0,0 +1,36 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-config-mode-reboot-ffhh
PKG_VERSION:=2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(GLUONDIR)/include/package.mk
define Package/gluon-config-mode-reboot-ffhh
SECTION:=gluon
CATEGORY:=Gluon
TITLE:=Show text on reboot page if mesh vpn is disabled
DEPENDS:=+gluon-config-mode-core
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/gluon-config-mode-reboot-ffhh/install
$(CP) ./files/* $(1)/
endef
define Package/gluon-config-mode-reboot-ffhh/postinst
#!/bin/sh
$(call GluonCheckSite,check_site.lua)
endef
$(eval $(call BuildPackage,gluon-config-mode-reboot-ffhh))

View file

@ -0,0 +1 @@
need_string 'config_mode.msg_nopubkey'

View file

@ -0,0 +1,22 @@
local msg = [[<p>
<%= luci.template.render_string(site.config_mode.msg_nopubkey) %>
</p>]]
local uci = luci.model.uci.cursor()
local meshvpn_enabled = uci:get("fastd", "mesh_vpn", "enabled", "0")
if meshvpn_enabled == "1" then
return nil
else
local site = require 'gluon.site_config'
local sysconfig = require 'gluon.sysconfig'
local hostname = uci:get_first("system", "system", "hostname")
return function ()
luci.template.render_string(msg, { hostname=hostname
, site=site
, sysconfig=sysconfig
})
end
end