From 7483c1301227a7aec61d8bcd129e0edc8ec866b3 Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Wed, 27 Nov 2019 08:32:15 -0700 Subject: luci-app-advanced-reboot: better information for snapshots Signed-off-by: Stan Grishin --- .../luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua') diff --git a/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua b/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua index 112ac8a0d4..6ed4c66149 100644 --- a/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua +++ b/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua @@ -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) -- cgit v1.2.3