luci-app-advanced-reboot: better information for snapshots 3367/head
authorStan Grishin <stangri@melmac.net>
Wed, 27 Nov 2019 15:32:30 +0000 (08:32 -0700)
committerStan Grishin <stangri@melmac.net>
Wed, 27 Nov 2019 15:32:30 +0000 (08:32 -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 e3037df2f8ba5d528aa925a945bd29a52de15f77..97301fc6afe4fbba32d7b374062083089e0840f3 100644 (file)
@@ -13,7 +13,7 @@ LUCI_DESCRIPTION:=Provides Web UI (found under System/Advanced Reboot) to reboot
 
 LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full
 LUCI_PKGARCH:=all
-PKG_RELEASE:=45
+PKG_RELEASE:=46
 
 include ../../luci.mk
 
index 112ac8a0d4343071853e7b7f5c8e3cb297909f4e..6ed4c6614931536cb5ce14f463732934b2ee4911 100644 (file)
@@ -37,12 +37,18 @@ function get_partition_os_info(op_ubi)
        local cp_info, ap_info
        if fs.access("/etc/os-release") then
                cp_info = util.trim(util.exec('. /etc/os-release && echo "$PRETTY_NAME"'))
+               if cp_info:find("SNAPSHOT") then
+                       cp_info = util.trim(util.exec('. /etc/os-release && echo "$OPENWRT_RELEASE"'))
+               end 
        end
        logger(i18n.translate("attempting to mount alternative partition") .. " (mtd" .. tostring(op_ubi) .. ")")
        alt_partition_unmount(op_ubi)
        alt_partition_mount(op_ubi)
        if fs.access("/alt/rom/etc/os-release") then
                ap_info = util.trim(util.exec('. /alt/rom/etc/os-release && echo "$PRETTY_NAME"'))
+               if ap_info:find("SNAPSHOT") then
+                       ap_info = util.trim(util.exec('. /alt/rom/etc/os-release && echo "$OPENWRT_RELEASE"'))
+               end 
        end
        logger(i18n.translate("attempting to unmount alternative partition") .. " (mtd" .. tostring(op_ubi) .. ")")
        alt_partition_unmount(op_ubi)