luci-app-advanced-reboot: bugfix for when network.lan.ipaddr is a table 3015/head
authorStan Grishin <stangri@melmac.net>
Tue, 27 Aug 2019 06:07:49 +0000 (23:07 -0700)
committerStan Grishin <stangri@melmac.net>
Tue, 27 Aug 2019 06:07:49 +0000 (23:07 -0700)
Signed-off-by: Stan Grishin <stangri@melmac.net>
applications/luci-app-advanced-reboot/Makefile
applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua

index 5381059da709a99fb43cf62089bd4e884e7b1992..329acece4fcab625e905831045b0ec93a22e3d2c 100644 (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
 
index e1f6daac18c0ae6657fd7e38c8cbfbd5a8971375..733242486692ba44740884c97bb916e129acae75 100644 (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