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:
parent
cc08450972
commit
918d892f15
10 changed files with 59 additions and 358 deletions
36
gluon-config-mode-reboot-ffhh/Makefile
Normal file
36
gluon-config-mode-reboot-ffhh/Makefile
Normal 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))
|
1
gluon-config-mode-reboot-ffhh/check_site.lua
Normal file
1
gluon-config-mode-reboot-ffhh/check_site.lua
Normal file
|
@ -0,0 +1 @@
|
|||
need_string 'config_mode.msg_nopubkey'
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue