package/luci-app-ota: hide luci menu on unsupported target

This commit is contained in:
jjm2473 2023-04-06 11:31:31 +08:00
parent 75f4525e56
commit 6382a4bc1e
2 changed files with 5 additions and 1 deletions

View File

@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI for OTA upgrade
LUCI_PKGARCH:=all
PKG_VERSION:=1.3.0
PKG_VERSION:=1.3.1
PKG_RELEASE:=1
PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>

View File

@ -7,6 +7,10 @@ module("luci.controller.admin.ota",package.seeall)
require "luci.util"
function index()
if luci.sys.call("ota >/dev/null 2>&1") ~= 0 then
return
end
entry({"admin", "system", "ota"}, post_on({ apply = "1" }, "action_ota"), _("OTA"), 69)
entry({"admin", "system", "ota", "check"}, post("action_check"))
entry({"admin", "system", "ota", "download"}, post("action_download"))