Merge pull request #3016 from stangri/19.07-luci-app-advanced-reboot

[19.07] luci-app-advanced-reboot/: bugfix for when network.lan.ipaddr is a table
This commit is contained in:
Hannu Nyman 2019-08-27 16:56:05 +03:00 committed by GitHub
commit e075dd8e92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -13,7 +13,7 @@ LUCI_DESCRIPTION:=Provides Web UI (found under System/Advanced Reboot) to reboot
LUCI_DEPENDS:=+luci-mod-admin-full
LUCI_PKGARCH:=all
PKG_RELEASE:=41
PKG_RELEASE:=42
include ../../luci.mk

View file

@ -88,10 +88,11 @@ end
function action_reboot()
local uci = require "luci.model.uci".cursor()
local ip = uci:get("network", "lan", "ipaddr")
luci.template.render("admin_system/applyreboot", {
title = luci.i18n.translate("Rebooting..."),
msg = luci.i18n.translate("The system is rebooting now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It might be necessary to renew the address of your computer to reach the device again, depending on your settings."),
addr = luci.ip.new(uci:get("network", "lan", "ipaddr")) or "192.168.1.1"
addr = luci.ip.new(type(ip) == "string" and ip or "192.168.1.1") or "192.168.1.1"
})
luci.sys.reboot()
end