diff options
Diffstat (limited to 'applications/luci-app-advanced-reboot')
9 files changed, 441 insertions, 327 deletions
diff --git a/applications/luci-app-advanced-reboot/Makefile b/applications/luci-app-advanced-reboot/Makefile index 329acece4f..a08d57fd8b 100644 --- a/applications/luci-app-advanced-reboot/Makefile +++ b/applications/luci-app-advanced-reboot/Makefile @@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk -PKG_LICENSE:=GPL-3.0+ +PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net> LUCI_TITLE:=Advanced Linksys Reboot Web UI @@ -11,9 +11,9 @@ LUCI_DESCRIPTION:=Provides Web UI (found under System/Advanced Reboot) to reboot an alternative partition. Also provides Web UI to shut down (power off) your device. Supported dual-partition\ routers are listed at https://github.com/openwrt/luci/blob/master/applications/luci-app-advanced-reboot/README.md -LUCI_DEPENDS:=+luci-mod-admin-full +LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full LUCI_PKGARCH:=all -PKG_RELEASE:=42 +PKG_RELEASE:=43 include ../../luci.mk diff --git a/applications/luci-app-advanced-reboot/README.md b/applications/luci-app-advanced-reboot/README.md index 61e43637d1..50ca1bc2d6 100644 --- a/applications/luci-app-advanced-reboot/README.md +++ b/applications/luci-app-advanced-reboot/README.md @@ -22,11 +22,11 @@ Currently supported dual-partition devices include: - Linksys WRT32X - ZyXEL NBG6817 -If you're interested in having your device supported, please post in [OpenWrt Forum Support Thread](https://forum.openwrt.org/t/web-ui-to-reboot-to-another-partition-dual-partition-routers/3423). +If your device is not in the list above, however it is a [dual-firmware device](https://openwrt.org/tag/dual_firmware?do=showtag&tag=dual_firmware) and you're interested in having your device supported, please post in [OpenWrt Forum Support Thread](https://forum.openwrt.org/t/web-ui-to-reboot-to-another-partition-dual-partition-routers/3423). ## Screenshot (luci-app-advanced-reboot) -![screenshot](https://raw.githubusercontent.com/stangri/openwrt_packages/master/screenshots/luci-app-advanced-reboot/screenshot01.png "screenshot") +![screenshot](https://raw.githubusercontent.com/stangri/openwrt_packages/master/screenshots/luci-app-advanced-reboot/screenshot02.png "screenshot") ## How to install 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 6b8cba4c40..8b97f2e560 100644 --- a/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua +++ b/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua @@ -3,203 +3,282 @@ module("luci.controller.advanced_reboot", package.seeall) +local util = require "luci.util" +local fs = require "nixio.fs" +local sys = require "luci.sys" +local http = require "luci.http" +local dispatcher = require "luci.dispatcher" +local i18n = require "luci.i18n" +local ltemplate = require "luci.template" +local ip = require "luci.ip" +local http = require "luci.http" +local sys = require "luci.sys" +local dispatcher = require "luci.dispatcher" +local uci = require "luci.model.uci".cursor() + +function is_alt_mountable(p1_mtd, p2_mtd) + if p1_mtd:sub(1,3) == "mtd" and + p2_mtd:sub(1,3) == "mtd" and + fs.access("/usr/sbin/ubiattach") and + fs.access("/usr/sbin/ubiblock") and + fs.access("/bin/mount") then + return true + else + return false + end +end + +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"')) + end + 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"')) + end + alt_partition_unmount(op_ubi) + return cp_info, ap_info +end + +function alt_partition_mount(op_ubi) + local ubi_dev + util.exec('for i in rom overlay firmware; do [ ! -d "$i" ] && mkdir -p "/alt/${i}"; done') + util.exec("ubidetach -m " .. tostring(op_ubi)) + ubi_dev = tostring(util.exec("ubiattach -m " .. tostring(op_ubi))) + _, _, ubi_dev = ubi_dev:find("UBI device number (%d+)") + if not ubi_dev then + util.exec("ubidetach -m " .. tostring(op_ubi)) + return + end + util.exec("ubiblock --create /dev/ubi" .. ubi_dev .. "_0") + util.exec("mount -t squashfs -o ro /dev/ubiblock" .. ubi_dev .. "_0 /alt/rom") + util.exec("mount -t ubifs /dev/ubi1_" .. ubi_dev .. " /alt/overlay") + util.exec("mount -t overlay overlay -o noatime,lowerdir=/alt/rom,upperdir=/alt/overlay/upper,workdir=/alt/overlay/work /alt/firmware") +end + +function alt_partition_unmount(op_ubi) + util.exec("umount /alt/firmware") + util.exec("umount /alt/overlay") + util.exec("umount /alt/rom") + util.exec("ubiblock --remove /dev/ubi1_0") + util.exec("ubidetach -m " .. tostring(op_ubi)) + util.exec('rm -rf /alt') +end + devices = { - -- deviceName, boardName, partition1, partition2, offset, envVar1, envVar1Value1, envVar1Value2, envVar2, envVar2Value1, envVar2Value2 - {"Linksys EA3500", "linksys-audi", "mtd3", "mtd5", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, - {"Linksys E4200v2/EA4500", "linksys-viper", "mtd3", "mtd5", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, - {"Linksys EA6350v3", "linksys-ea6350v3", "mtd10", "mtd12", 192, "boot_part", 1, 2}, - {"Linksys EA8300", "linksys-ea8300", "mtd10", "mtd12", 192, "boot_part", 1, 2}, - {"Linksys EA8500", "ea8500", "mtd13", "mtd15", 32, "boot_part", 1, 2}, + -- deviceName, boardName, part1MTD, part2MTD, offset, envVar1, envVar1Value1, envVar1Value2, envVar2, envVar2Value1, envVar2Value2 + {"Linksys EA3500", "linksys-audi", "mtd3", "mtd5", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, + {"Linksys E4200v2/EA4500", "linksys-viper", "mtd3", "mtd5", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, + {"Linksys EA6350v3", "linksys-ea6350v3", "mtd10", "mtd12", 192, "boot_part", 1, 2}, + {"Linksys EA8300", "linksys-ea8300", "mtd10", "mtd12", 192, "boot_part", 1, 2}, + {"Linksys EA8500", "ea8500", "mtd13", "mtd15", 32, "boot_part", 1, 2}, -- {"Linksys EA9500", "linksys-panamera", "mtd3", "mtd6", 28, "boot_part", 1, 2}, - {"Linksys WRT1200AC", "linksys-caiman", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, - {"Linksys WRT1900AC", "linksys-mamba", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, - {"Linksys WRT1900ACv2", "linksys-cobra", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, - {"Linksys WRT1900ACS", "linksys-shelby", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, - {"Linksys WRT3200ACM", "linksys-rango", "mtd5", "mtd7", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, - {"Linksys WRT32X", "linksys-venom", "mtd5", "mtd7", nil, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, - {"ZyXEL NBG6817","nbg6817","mmcblk0p4","mmcblk0p7", 32, nil, 255, 1} + {"Linksys WRT1200AC", "linksys-caiman", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, + {"Linksys WRT1900AC", "linksys-mamba", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, + {"Linksys WRT1900ACv2", "linksys-cobra", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, + {"Linksys WRT1900ACS", "linksys-shelby", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, + {"Linksys WRT3200ACM", "linksys-rango", "mtd5", "mtd7", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, + {"Linksys WRT32X", "linksys-venom", "mtd5", "mtd7", nil, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"}, + {"ZyXEL NBG6817", "nbg6817", "mmcblk0p4", "mmcblk0p7", 32, nil, 255, 1} } -errorMessage = nil -rom_board_name = luci.util.trim(luci.sys.exec("cat /tmp/sysinfo/board_name")) +-- local errorMessage, d +-- local device_name, p1_mtd, p2_mtd, offset, bev1, bev1p1, bev1p2, bev2, bev2p1, bev2p2 +romBoardName = util.trim(util.exec("cat /tmp/sysinfo/board_name")) + for i=1, #devices do - device_board_name = devices[i][2]:gsub('%p','') - if rom_board_name and rom_board_name:gsub('%p',''):match(device_board_name) then - device_name = devices[i][1] - partition_one_mtd = devices[i][3] or nil - partition_two_mtd = devices[i][4] or nil - partition_skip = devices[i][5] or nil - boot_envvar1 = devices[i][6] or nil - boot_envvar1_partition_one = tonumber(devices[i][7]) or nil - boot_envvar1_partition_two = tonumber(devices[i][8]) or nil - boot_envvar2 = devices[i][9] or nil - boot_envvar2_partition_one = devices[i][10] or nil - boot_envvar2_partition_two = devices[i][11] or nil - if partition_one_mtd and partition_skip then - partition_one_label = luci.util.trim(luci.sys.exec("dd if=/dev/" .. partition_one_mtd .. " bs=1 skip=" .. partition_skip .. " count=128" .. " 2>/dev/null")) - n, partition_one_version = string.match(partition_one_label, '(Linux)-([%d|.]+)') - end - if partition_two_mtd and partition_skip then - partition_two_label = luci.util.trim(luci.sys.exec("dd if=/dev/" .. partition_two_mtd .. " bs=1 skip=" .. partition_skip .. " count=128" .. " 2>/dev/null")) - n, partition_two_version = string.match(partition_two_label, '(Linux)-([%d|.]+)') - end - if partition_one_label and string.find(partition_one_label, "LEDE") then partition_one_os = "LEDE" end - if partition_one_label and string.find(partition_one_label, "OpenWrt") then partition_one_os = "OpenWrt" end - if partition_one_label and string.find(partition_one_label, "Linksys") then partition_one_os = "Linksys" end - if partition_two_label and string.find(partition_two_label, "LEDE") then partition_two_os = "LEDE" end - if partition_two_label and string.find(partition_two_label, "OpenWrt") then partition_two_os = "OpenWrt" end - if partition_two_label and string.find(partition_two_label, "Linksys") then partition_two_os = "Linksys" end - if device_name and device_name == "ZyXEL NBG6817" then - if not partition_one_os then partition_one_os = "ZyXEL" end - if not partition_two_os then partition_two_os = "ZyXEL" end - end - if device_name and device_name == "Linksys WRT32X" then - if not partition_one_os then partition_one_os = "Unknown/Compressed" end - if not partition_two_os then partition_two_os = "Unknown/Compressed" end - end - if not partition_one_os then partition_one_os = "Unknown" end - if not partition_two_os then partition_two_os = "Unknown" end - if partition_one_os and partition_one_version then partition_one_os = partition_one_os .. " (Linux " .. partition_one_version .. ")" end - if partition_two_os and partition_two_version then partition_two_os = partition_two_os .. " (Linux " .. partition_two_version .. ")" end + d = devices[i][2]:gsub('%p','') + if romBoardName and romBoardName:gsub('%p',''):match(d) then + device_name = devices[i][1] + p1_mtd = devices[i][3] or nil + p2_mtd = devices[i][4] or nil + offset = devices[i][5] or nil + bev1 = devices[i][6] or nil + bev1p1 = tonumber(devices[i][7]) or nil + bev1p2 = tonumber(devices[i][8]) or nil + bev2 = devices[i][9] or nil + bev2p1 = devices[i][10] or nil + bev2p2 = devices[i][11] or nil + if p1_mtd and offset then + p1_label = util.trim(util.exec("dd if=/dev/" .. p1_mtd .. " bs=1 skip=" .. offset .. " count=128" .. " 2>/dev/null")) + n, p1_version = p1_label:match('(Linux)-([%d|.]+)') + end + if p2_mtd and offset then + p2_label = util.trim(util.exec("dd if=/dev/" .. p2_mtd .. " bs=1 skip=" .. offset .. " count=128" .. " 2>/dev/null")) + n, p2_version = p2_label:match('(Linux)-([%d|.]+)') + end + if p1_label and p1_label:find("LEDE") then p1_os = "LEDE" end + if p1_label and p1_label:find("OpenWrt") then p1_os = "OpenWrt" end + if p1_label and p1_label:find("Linksys") then p1_os = "Linksys" end + if p2_label and p2_label:find("LEDE") then p2_os = "LEDE" end + if p2_label and p2_label:find("OpenWrt") then p2_os = "OpenWrt" end + if p2_label and p2_label:find("Linksys") then p2_os = "Linksys" end + if device_name == "ZyXEL NBG6817" then + if not p1_os then p1_os = "ZyXEL" end + if not p2_os then p2_os = "ZyXEL" end + end + if device_name == "Linksys WRT32X" then + if not p1_os then p1_os = "Unknown/Compressed" end + if not p2_os then p2_os = "Unknown/Compressed" end + end + if not p1_os then p1_os = "Unknown" end + if not p2_os then p2_os = "Unknown" end + if p1_os and p1_version then p1_os = p1_os .. " (Linux " .. p1_version .. ")" end + if p2_os and p2_version then p2_os = p2_os .. " (Linux " .. p2_version .. ")" end - if device_name and device_name == "ZyXEL NBG6817" then - if not zyxelFlagPartition then zyxelFlagPartition = luci.util.trim(luci.sys.exec("source /lib/functions.sh; find_mtd_part 0:DUAL_FLAG")) end - if not zyxelFlagPartition then - errorMessage = errorMessage or "" .. luci.i18n.translate("Unable to find Dual Boot Flag Partition." .. " ") - luci.util.perror(luci.i18n.translate("Unable to find Dual Boot Flag Partition.")) - else - current_partition = tonumber(luci.sys.exec("dd if=" .. zyxelFlagPartition .. " bs=1 count=1 2>/dev/null | hexdump -n 1 -e '1/1 \"%d\"'")) - end - else - if nixio.fs.access("/usr/sbin/fw_printenv") and nixio.fs.access("/usr/sbin/fw_setenv") then - current_partition = tonumber(luci.util.trim(luci.sys.exec("/usr/sbin/fw_printenv -n " .. boot_envvar1))) - end - end - other_partition = current_partition == boot_envvar1_partition_two and boot_envvar1_partition_one or boot_envvar1_partition_two - end + if device_name == "ZyXEL NBG6817" then + if not zyxelFlagPartition then zyxelFlagPartition = util.trim(util.exec(". /lib/functions.sh; find_mtd_part 0:DUAL_FLAG")) end + if not zyxelFlagPartition then + errorMessage = errorMessage or "" .. i18n.translate("Unable to find Dual Boot Flag Partition." .. " ") + util.perror(i18n.translate("Unable to find Dual Boot Flag Partition.")) + else + current_partition = tonumber(util.exec("dd if=" .. zyxelFlagPartition .. " bs=1 count=1 2>/dev/null | hexdump -n 1 -e '1/1 \"%d\"'")) + end + else + if fs.access("/usr/sbin/fw_printenv") and fs.access("/usr/sbin/fw_setenv") then + current_partition = tonumber(util.trim(util.exec("fw_printenv -n " .. bev1))) + end + end + other_partition = current_partition == bev1p2 and bev1p1 or bev1p2 + + if is_alt_mountable(p1_mtd, p2_mtd) then + if current_partition == bev1p1 then + op_ubi = tonumber(p2_mtd:sub(4)) + 1 + else + op_ubi = tonumber(p1_mtd:sub(4)) + 1 + end + local cp_info, ap_info = get_partition_os_info(op_ubi) + if current_partition == bev1p1 then + p1_os = cp_info or p1_os + p2_os = ap_info or p2_os + else + p1_os = ap_info or p1_os + p2_os = cp_info or p2_os + end + end + end end function index() - entry({"admin", "system", "advanced_reboot"}, template("advanced_reboot/advanced_reboot"), _("Advanced Reboot"), 90) - entry({"admin", "system", "advanced_reboot", "reboot"}, post("action_reboot")) - entry({"admin", "system", "advanced_reboot", "alternative_reboot"}, post("action_altreboot")) - entry({"admin", "system", "advanced_reboot", "power_off"}, post("action_poweroff")) + entry({"admin", "system", "advanced_reboot"}, template("advanced_reboot/advanced_reboot"), _("Advanced Reboot"), 90) + entry({"admin", "system", "advanced_reboot", "reboot"}, post("action_reboot")) + entry({"admin", "system", "advanced_reboot", "alternative_reboot"}, post("action_altreboot")) + entry({"admin", "system", "advanced_reboot", "power_off"}, post("action_poweroff")) end function action_reboot() - local uci = require "luci.model.uci".cursor() - local ip = uci:get("network", "lan", "ipaddr") - luci.template.render("advanced_reboot/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(type(ip) == "string" and ip or "192.168.1.1") or "192.168.1.1" - }) - luci.sys.reboot() + ltemplate.render("admin_system/applyreboot", { + title = i18n.translate("Rebooting..."), + msg = 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 = ip.new(type(ip) == "string" and ip or "192.168.1.1") or "192.168.1.1" + }) + sys.reboot() end function action_altreboot() - local uci = require "luci.model.uci".cursor() - local zyxelFlagPartition, zyxelBootFlag, zyxelNewBootFlag, errorCode, curEnvSetting, newEnvSetting - errorMessage = nil - errorCode = 0 - if luci.http.formvalue("cancel") then - luci.http.redirect(luci.dispatcher.build_url('admin/system/advanced_reboot')) - return - end - local step = tonumber(luci.http.formvalue("step") or 1) - if step == 1 then - if device_name and nixio.fs.access("/usr/sbin/fw_printenv") and nixio.fs.access("/usr/sbin/fw_setenv") then - luci.template.render("advanced_reboot/alternative_reboot",{}) - else - luci.template.render("advanced_reboot/advanced_reboot",{errorMessage = luci.i18n.translate("No access to fw_printenv or fw_printenv!")}) - end - elseif step == 2 then - if boot_envvar1 or boot_envvar2 then -- Linksys devices - if boot_envvar1 then - curEnvSetting = tonumber(luci.util.trim(luci.sys.exec("/usr/sbin/fw_printenv -n " .. boot_envvar1))) - if not curEnvSetting then - errorMessage = errorMessage .. luci.i18n.translate("Unable to obtain firmware environment variable") .. ": " .. boot_envvar1 .. ". " - luci.util.perror(luci.i18n.translate("Unable to obtain firmware environment variable") .. ": " .. boot_envvar1 .. ".") - else - newEnvSetting = curEnvSetting == boot_envvar1_partition_one and boot_envvar1_partition_two or boot_envvar1_partition_one - errorCode = luci.sys.call("/usr/sbin/fw_setenv " .. boot_envvar1 .. " " .. newEnvSetting) - if errorCode ~= 0 then - errorMessage = errorMessage or "" .. luci.i18n.translate("Unable to set firmware environment variable") .. ": " .. boot_envvar1 .. " " .. luci.i18n.translate("to") .. " " .. newEnvSetting .. ". " - luci.util.perror(luci.i18n.translate("Unable to set firmware environment variable") .. ": " .. boot_envvar1 .. " " .. luci.i18n.translate("to") .. " " .. newEnvSetting .. ".") - end - end - end - if boot_envvar2 then - curEnvSetting = luci.util.trim(luci.sys.exec("/usr/sbin/fw_printenv -n " .. boot_envvar2)) - if not curEnvSetting then - errorMessage = errorMessage or "" .. luci.i18n.translate("Unable to obtain firmware environment variable") .. ": " .. boot_envvar2 .. ". " - luci.util.perror(luci.i18n.translate("Unable to obtain firmware environment variable") .. ": " .. boot_envvar2 .. ".") - else - newEnvSetting = curEnvSetting == boot_envvar2_partition_one and boot_envvar2_partition_two or boot_envvar2_partition_one - errorCode = luci.sys.call("/usr/sbin/fw_setenv " .. boot_envvar2 .. " '" .. newEnvSetting .. "'") - if errorCode ~= 0 then - errorMessage = errorMessage or "" .. luci.i18n.translate("Unable to set firmware environment variable") .. ": " .. boot_envvar2 .. " " .. luci.i18n.translate("to") .. " " .. newEnvSetting .. ". " - luci.util.perror(luci.i18n.translate("Unable to set firmware environment variable") .. ": " .. boot_envvar2 .. " " .. luci.i18n.translate("to") .. " " .. newEnvSetting .. ".") - end - end - end - else -- NetGear device - if not zyxelFlagPartition then zyxelFlagPartition = luci.util.trim(luci.sys.exec("source /lib/functions.sh; find_mtd_part 0:DUAL_FLAG")) end - if not zyxelFlagPartition then - errorMessage = errorMessage .. luci.i18n.translate("Unable to find Dual Boot Flag Partition." .. " ") - luci.util.perror(luci.i18n.translate("Unable to find Dual Boot Flag Partition.")) - else - zyxelBootFlag = tonumber(luci.sys.exec("dd if=" .. zyxelFlagPartition .. " bs=1 count=1 2>/dev/null | hexdump -n 1 -e '1/1 \"%d\"'")) - zyxelNewBootFlag = zyxelBootFlag and zyxelBootFlag == 1 and "\\xff" or "\\x01" - if zyxelNewBootFlag then - errorCode = luci.sys.call("printf \"" .. zyxelNewBootFlag .. "\" >" .. zyxelFlagPartition ) - if errorCode ~= 0 then - errorMessage = errorMessage or "" .. luci.i18n.translate("Unable to set Dual Boot Flag Partition entry for partition") .. ": " .. zyxelFlagPartition .. ". " - luci.util.perror(luci.i18n.translate("Unable to set Dual Boot Flag Partition entry for partition") .. ": " .. zyxelFlagPartition .. ".") - end - end - end - end - if not errorMessage then - luci.template.render("advanced_reboot/applyreboot", { - title = luci.i18n.translate("Rebooting..."), - msg = luci.i18n.translate("The system is rebooting to an alternative partition 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" - }) - luci.sys.reboot() - else - luci.template.render("advanced_reboot/advanced_reboot",{ - rom_board_name=rom_board_name, - device_name=device_name, - boot_envvar1_partition_one=boot_envvar1_partition_one, - partition_one_os=partition_one_os, - boot_envvar1_partition_two=boot_envvar1_partition_two, - partition_two_os=partition_two_os, - current_partition=current_partition, - errorMessage = errorMessage}) - end - end + local zyxelFlagPartition, zyxelBootFlag, zyxelNewBootFlag, errorCode, curEnvSetting, newEnvSetting + errorMessage = nil + errorCode = 0 + if http.formvalue("cancel") then + http.redirect(dispatcher.build_url('admin/system/advanced_reboot')) + return + end + local step = tonumber(http.formvalue("step") or 1) + if step == 1 then + if fs.access("/usr/sbin/fw_printenv") and fs.access("/usr/sbin/fw_setenv") then + ltemplate.render("advanced_reboot/alternative_reboot",{}) + else + ltemplate.render("advanced_reboot/advanced_reboot",{errorMessage = i18n.translate("No access to fw_printenv or fw_printenv!")}) + end + elseif step == 2 then + if bev1 or bev2 then -- Linksys devices + if bev1 then + curEnvSetting = tonumber(util.trim(util.exec("fw_printenv -n " .. bev1))) + if not curEnvSetting then + errorMessage = errorMessage .. i18n.translate("Unable to obtain firmware environment variable") .. ": " .. bev1 .. ". " + util.perror(i18n.translate("Unable to obtain firmware environment variable") .. ": " .. bev1 .. ".") + else + newEnvSetting = curEnvSetting == bev1p1 and bev1p2 or bev1p1 + errorCode = sys.call("fw_setenv " .. bev1 .. " " .. newEnvSetting) + if errorCode ~= 0 then + errorMessage = errorMessage or "" .. i18n.translate("Unable to set firmware environment variable") .. ": " .. bev1 .. " " .. i18n.translate("to") .. " " .. newEnvSetting .. ". " + util.perror(i18n.translate("Unable to set firmware environment variable") .. ": " .. bev1 .. " " .. i18n.translate("to") .. " " .. newEnvSetting .. ".") + end + end + end + if bev2 then + curEnvSetting = util.trim(util.exec("fw_printenv -n " .. bev2)) + if not curEnvSetting then + errorMessage = errorMessage or "" .. i18n.translate("Unable to obtain firmware environment variable") .. ": " .. bev2 .. ". " + util.perror(i18n.translate("Unable to obtain firmware environment variable") .. ": " .. bev2 .. ".") + else + newEnvSetting = curEnvSetting == bev2p1 and bev2p2 or bev2p1 + errorCode = sys.call("fw_setenv " .. bev2 .. " '" .. newEnvSetting .. "'") + if errorCode ~= 0 then + errorMessage = errorMessage or "" .. i18n.translate("Unable to set firmware environment variable") .. ": " .. bev2 .. " " .. i18n.translate("to") .. " " .. newEnvSetting .. ". " + util.perror(i18n.translate("Unable to set firmware environment variable") .. ": " .. bev2 .. " " .. i18n.translate("to") .. " " .. newEnvSetting .. ".") + end + end + end + else -- NetGear device + if not zyxelFlagPartition then zyxelFlagPartition = util.trim(util.exec(". /lib/functions.sh; find_mtd_part 0:DUAL_FLAG")) end + if not zyxelFlagPartition then + errorMessage = errorMessage .. i18n.translate("Unable to find Dual Boot Flag Partition." .. " ") + util.perror(i18n.translate("Unable to find Dual Boot Flag Partition.")) + else + zyxelBootFlag = tonumber(util.exec("dd if=" .. zyxelFlagPartition .. " bs=1 count=1 2>/dev/null | hexdump -n 1 -e '1/1 \"%d\"'")) + zyxelNewBootFlag = zyxelBootFlag and zyxelBootFlag == 1 and "\\xff" or "\\x01" + if zyxelNewBootFlag then + errorCode = sys.call("printf \"" .. zyxelNewBootFlag .. "\" >" .. zyxelFlagPartition ) + if errorCode ~= 0 then + errorMessage = errorMessage or "" .. i18n.translate("Unable to set Dual Boot Flag Partition entry for partition") .. ": " .. zyxelFlagPartition .. ". " + util.perror(i18n.translate("Unable to set Dual Boot Flag Partition entry for partition") .. ": " .. zyxelFlagPartition .. ".") + end + end + end + end + if not errorMessage then + ltemplate.render("admin_system/applyreboot", { + title = i18n.translate("Rebooting..."), + msg = i18n.translate("The system is rebooting to an alternative partition 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 = ip.new(uci:get("network", "lan", "ipaddr")) or "192.168.1.1" + }) + sys.reboot() + else + ltemplate.render("advanced_reboot/advanced_reboot",{ + romBoardName=romBoardName, + device_name=device_name, + bev1p1=bev1p1, + p1_os=p1_os, + bev1p2=bev1p2, + p2_os=p2_os, + current_partition=current_partition, + errorMessage = errorMessage}) + end + end end function action_poweroff() - local uci = require "luci.model.uci".cursor() - if luci.http.formvalue("cancel") then - luci.http.redirect(luci.dispatcher.build_url('admin/system/advanced_reboot')) - return - end - local step = tonumber(luci.http.formvalue("step") or 1) - if step == 1 then - if nixio.fs.access("/sbin/poweroff") then - luci.template.render("advanced_reboot/power_off",{}) - else - luci.template.render("advanced_reboot/advanced_reboot",{}) - end - elseif step == 2 then - luci.template.render("advanced_reboot/applyreboot", { - title = luci.i18n.translate("Shutting down..."), - msg = luci.i18n.translate("The system is shutting down now.<br /> DO NOT POWER OFF THE DEVICE!<br /> 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" - }) - luci.sys.call("/sbin/poweroff") - end + local uci = require "luci.model.uci".cursor() + if http.formvalue("cancel") then + http.redirect(dispatcher.build_url('admin/system/advanced_reboot')) + return + end + local step = tonumber(http.formvalue("step") or 1) + if step == 1 then + if fs.access("/sbin/poweroff") then + ltemplate.render("advanced_reboot/power_off",{}) + else + ltemplate.render("advanced_reboot/advanced_reboot",{}) + end + elseif step == 2 then + ltemplate.render("admin_system/applyreboot", { + title = i18n.translate("Shutting down..."), + msg = i18n.translate("The system is shutting down now.<br /> DO NOT POWER OFF THE DEVICE!<br /> It might be necessary to renew the address of your computer to reach the device again, depending on your settings."), + addr = ip.new(uci:get("network", "lan", "ipaddr")) or "192.168.1.1" + }) + sys.call("/sbin/poweroff") + end end diff --git a/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm b/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm index 5c14f52ff8..f3d8338c47 100644 --- a/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm +++ b/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm @@ -20,70 +20,70 @@ <%- if device_name then -%> <fieldset class="cbi-section"> - <legend><%=device_name%><%: Partitions%></legend> - <div class="table cbi-section-table" id="partitions"> - <div class="tr cbi-section-table-titles"> - <div class="th cbi-section-table-cell"><%:Partition%></div> - <div class="th cbi-section-table-cell"><%:Status%></div> - <div class="th cbi-section-table-cell"><%:Firmware/OS (Kernel)%></div> - <div class="th cbi-section-table-cell"><%:Action%></div> - </div> - <div class="tr cbi-section-table-row"> - <div class="td"> - <%=string.format("%X", boot_envvar1_partition_one)%> - </div> - <div class="td"> - <%- if boot_envvar1_partition_one == current_partition then -%><%:Current%><%- else -%><%:Alternative%><%- end -%> - </div> - <div class="td"> - <%=partition_one_os%> - </div> - <div class="td"> - <%- if boot_envvar1_partition_one == current_partition then -%> - <form method="post" action="<%=url('admin/system/advanced_reboot/reboot')%>"> - <input type="hidden" name="token" value="<%=token%>" /> - <input id="reboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to current partition%>" /> - </form> - <%- else -%> - <form method="post" action="<%=url('admin/system/advanced_reboot/alternative_reboot')%>"> - <input type="hidden" name="token" value="<%=token%>" /> - <input id="altreboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to alternative partition...%>" /> - </form> - <%- end -%> - </div> - </div> - <div class="tr cbi-section-table-row"> - <div class="td"> - <%=string.format("%X", boot_envvar1_partition_two)%> - </div> - <div class="td"> - <%- if boot_envvar1_partition_two == current_partition then -%><%:Current%><%- else -%><%:Alternative%><%- end -%> - </div> - <div class="td"> - <%=partition_two_os%> - </div> - <div class="td"> - <%- if boot_envvar1_partition_two == current_partition then -%> - <form method="post" action="<%=url('admin/system/advanced_reboot/reboot')%>"> - <input type="hidden" name="token" value="<%=token%>" /> - <input id="reboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to current partition%>" /> - </form> - <%- else -%> - <form method="post" action="<%=url('admin/system/advanced_reboot/alternative_reboot')%>"> - <input type="hidden" name="token" value="<%=token%>" /> - <input id="altreboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to alternative partition...%>" /> - </form> - <%- end -%> - </div> - </div> - </div> + <legend><%=device_name%><%: Partitions%></legend> + <div class="table cbi-section-table" id="partitions"> + <div class="tr cbi-section-table-titles"> + <div class="th cbi-section-table-cell"><%:Partition%></div> + <div class="th cbi-section-table-cell"><%:Status%></div> + <div class="th cbi-section-table-cell"><%:Firmware%></div> + <div class="th cbi-section-table-cell"><%:Reboot%></div> + </div> + <div class="tr cbi-section-table-row cbi-rowstyle-1"> + <div class="td"> + <%=string.format("%X", bev1p1)%> + </div> + <div class="td"> + <%- if bev1p1 == current_partition then -%><%:Current%><%- else -%><%:Alternative%><%- end -%> + </div> + <div class="td"> + <%=p1_os%> + </div> + <div class="td"> + <%- if bev1p1 == current_partition then -%> + <form method="post" action="<%=url('admin/system/advanced_reboot/reboot')%>"> + <input type="hidden" name="token" value="<%=token%>" /> + <input id="reboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to current partition%>" /> + </form> + <%- else -%> + <form method="post" action="<%=url('admin/system/advanced_reboot/alternative_reboot')%>"> + <input type="hidden" name="token" value="<%=token%>" /> + <input id="altreboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to alternative partition...%>" /> + </form> + <%- end -%> + </div> + </div> + <div class="tr cbi-section-table-row cbi-rowstyle-2"> + <div class="td"> + <%=string.format("%X", bev1p2)%> + </div> + <div class="td"> + <%- if bev1p2 == current_partition then -%><%:Current%><%- else -%><%:Alternative%><%- end -%> + </div> + <div class="td"> + <%=p2_os%> + </div> + <div class="td"> + <%- if bev1p2 == current_partition then -%> + <form method="post" action="<%=url('admin/system/advanced_reboot/reboot')%>"> + <input type="hidden" name="token" value="<%=token%>" /> + <input id="reboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to current partition%>" /> + </form> + <%- else -%> + <form method="post" action="<%=url('admin/system/advanced_reboot/alternative_reboot')%>"> + <input type="hidden" name="token" value="<%=token%>" /> + <input id="altreboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to alternative partition...%>" /> + </form> + <%- end -%> + </div> + </div> + </div> </fieldset> <%- else -%> - <%- if rom_board_name then -%> - <p class="alert-message warning"><%=pcdata(translatef("Warning: Device (%s) is unknown or isn't a dual-partition device!", rom_board_name))%></p> - <%- else -%> - <p class="alert-message warning"><%=pcdata(translatef("Warning: Unable to obtain device information!"))%></p> - <%- end -%> + <%- if rom_board_name then -%> + <p class="alert-message warning"><%=pcdata(translatef("Warning: Device (%s) is unknown or isn't a dual-partition device!", rom_board_name))%></p> + <%- else -%> + <p class="alert-message warning"><%=pcdata(translatef("Warning: Unable to obtain device information!"))%></p> + <%- end -%> <%- end -%> <hr /> @@ -91,10 +91,10 @@ <%- if nixio.fs.access("/sbin/poweroff") then -%> <form method="post" action="<%=url('admin/system/advanced_reboot/power_off')%>"> <input type="hidden" name="token" value="<%=token%>" /> - <input id="poweroff-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Perform power off...%>" /> + <input id="poweroff-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Perform power off...%>" /> </form> <%- else -%> - <p class="alert-message warning"><%:Warning: This system does not support powering off!%></p> + <p class="alert-message warning"><%:Warning: This system does not support powering off!%></p> <%- end -%> <%+footer%> diff --git a/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm b/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm index b15f16b0d5..db11020628 100644 --- a/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm +++ b/applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm @@ -10,10 +10,10 @@ <h2 name="content"><%:Reboot Device to an Alternative Partition%> - <%:Confirm%></h2> <p> <%_ WARNING: An alternative partition might have its own settings and completely different firmware.<br /><br /> - As your network configuration and WiFi SSID/password on alternative partition might be different, - you might have to adjust your computer settings to be able to access your device once it reboots.<br /><br /> - Please also be aware that alternative partition firmware might not provide an easy way to switch active partition - and boot back to the currently active partition.<br /><br /> + As your network configuration and WiFi SSID/password on alternative partition might be different, + you might have to adjust your computer settings to be able to access your device once it reboots.<br /><br /> + Please also be aware that alternative partition firmware might not provide an easy way to switch active partition + and boot back to the currently active partition.<br /><br /> Click "Proceed" below to reboot device to an alternative partition. %> </p> diff --git a/applications/luci-app-advanced-reboot/po/ru/advanced-reboot.po b/applications/luci-app-advanced-reboot/po/ru/advanced-reboot.po index 7cd54f7c04..9c29adf6c9 100644 --- a/applications/luci-app-advanced-reboot/po/ru/advanced-reboot.po +++ b/applications/luci-app-advanced-reboot/po/ru/advanced-reboot.po @@ -1,17 +1,18 @@ msgid "" msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: LuCI: advanced-reboot\n" "POT-Creation-Date: 2017-11-30 15:20+0300\n" -"PO-Revision-Date: 2018-01-05 19:53+0300\n" -"Language-Team: http://cyber-place.ru\n" +"PO-Revision-Date: 2019-11-15 03:06+0000\n" +"Last-Translator: Alex Vinnick <alexv10@gmail.com>\n" +"Language-Team: Russian <https://hosted.weblate.org/projects/openwrt/" +"luciapplicationsadvanced-reboot/ru/>\n" +"Language: ru\n" "MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.7.1\n" -"Last-Translator: Vladimir aka sunny <picfun@ya.ru>\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -"Language: ru\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=" +"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 3.10-dev\n" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:29 msgid "Action" @@ -34,7 +35,7 @@ msgstr "Отменить" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:42 msgid "Changes applied." -msgstr "" +msgstr "Изменения установлены." #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:10 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:10 @@ -56,7 +57,7 @@ msgstr "Прошивка/ОС (Ядро)" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:45 msgid "Loading" -msgstr "" +msgstr "Загружаем" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:114 msgid "No access to fw_printenv or fw_printenv!" @@ -114,7 +115,7 @@ msgstr "Состояние" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:39 msgid "System" -msgstr "" +msgstr "Система" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:94 msgid "" @@ -209,11 +210,11 @@ msgstr "" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:46 msgid "Waiting for changes to be applied..." -msgstr "" +msgstr "Ждём установления изменений..." #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:83 msgid "Warning: Device (%s) is unknown or isn't a dual-partition device!" -msgstr "" +msgstr "Внимание: Устройство (%s) не известно или не имеет двойную перегородку!" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:14 msgid "Warning: There are unsaved changes that will get lost on reboot!" @@ -227,14 +228,14 @@ msgstr "Внимание: Эта система не поддерживает о #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:85 msgid "Warning: Unable to obtain device information!" -msgstr "" +msgstr "Внимание: Невозможно приобрести информацию устройства!" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:127 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:128 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:141 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:142 msgid "to" -msgstr "" +msgstr "в" #~ msgid "Alternative reboot cancelled." #~ msgstr "Альтернативная перезагрузка отменена." diff --git a/applications/luci-app-advanced-reboot/po/tr/advanced-reboot.po b/applications/luci-app-advanced-reboot/po/tr/advanced-reboot.po index 9442130cdf..fa2a4c40f3 100644 --- a/applications/luci-app-advanced-reboot/po/tr/advanced-reboot.po +++ b/applications/luci-app-advanced-reboot/po/tr/advanced-reboot.po @@ -1,45 +1,51 @@ msgid "" msgstr "" +"PO-Revision-Date: 2019-11-13 13:08+0000\n" +"Last-Translator: Yunus BAYRAK <yunus@baygunelektronik.com>\n" +"Language-Team: Turkish <https://hosted.weblate.org/projects/openwrt/" +"luciapplicationsadvanced-reboot/tr/>\n" "Language: tr\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.10-dev\n" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:29 msgid "Action" -msgstr "" +msgstr "Eylem" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:83 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:10 msgid "Advanced Reboot" -msgstr "" +msgstr "Gelişmiş Yeniden Başlatma" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:36 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:60 msgid "Alternative" -msgstr "" +msgstr "Alternatif" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:24 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:20 msgid "Cancel" -msgstr "" +msgstr "İptal" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:42 msgid "Changes applied." -msgstr "" +msgstr "Değişiklikler uygulandı." #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:10 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:10 msgid "Confirm" -msgstr "" +msgstr "Onayla" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:36 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:60 msgid "Current" -msgstr "" +msgstr "Geçerli" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:18 msgid "ERROR:" -msgstr "" +msgstr "HATA:" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:28 msgid "Firmware/OS (Kernel)" @@ -47,65 +53,65 @@ msgstr "" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:45 msgid "Loading" -msgstr "" +msgstr "Yükleniyor" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:114 msgid "No access to fw_printenv or fw_printenv!" -msgstr "" +msgstr "fw_printenv e veya fw_printenv e erişim yok!" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:26 msgid "Partition" -msgstr "" +msgstr "Bölüm" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:23 msgid "Partitions" -msgstr "" +msgstr "Bölümler" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:94 msgid "Perform power off..." -msgstr "" +msgstr "Güç kapat..." #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:10 msgid "Power Off Device" -msgstr "" +msgstr "Cihazın Gücünü Kapat" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:25 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:21 msgid "Proceed" -msgstr "" +msgstr "İlerle" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:10 msgid "Reboot Device to an Alternative Partition" -msgstr "" +msgstr "Alternatif Bölüm için cihazı yeniden başlat" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:50 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:74 msgid "Reboot to alternative partition..." -msgstr "" +msgstr "alternatif bölüm için yeniden başlat..." #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:45 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:69 msgid "Reboot to current partition" -msgstr "" +msgstr "Mevcut bölüm için yeniden başlat" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:93 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:165 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:9 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:39 msgid "Rebooting..." -msgstr "" +msgstr "Yeniden Başlatılıyor..." #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:199 msgid "Shutting down..." -msgstr "" +msgstr "Kapatılıyor..." #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:27 msgid "Status" -msgstr "" +msgstr "Durum" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:39 msgid "System" -msgstr "" +msgstr "Sistem" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:94 msgid "" @@ -114,6 +120,10 @@ msgid "" "address of your computer to reach the device again, depending on your " "settings." msgstr "" +"Sistem yeniden başlatılıyor.<br /> CİHAZ GÜCÜNÜ KAPATMAYIN!<br /> Yeniden " +"bağlanmayı denemeden önce birkaç dakika bekleyin.Bu ayarlarınıza göre, " +"yeniden cihaza erişebilmeniz için, bilgisayar adresinin yenilenmesinde " +"gereklidir." #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:166 msgid "" @@ -135,14 +145,14 @@ msgstr "" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:149 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:150 msgid "Unable to find Dual Boot Flag Partition." -msgstr "" +msgstr "Dual Boot Flag bölümü bulunamadı." #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:121 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:122 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:135 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:136 msgid "Unable to obtain firmware environment variable" -msgstr "" +msgstr "Firmware ortam değişkenine ulaşılamıyor" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:157 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:158 @@ -177,7 +187,7 @@ msgstr "" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:46 msgid "Waiting for changes to be applied..." -msgstr "" +msgstr "Değişikliklerin uygulanması bekleniyor..." #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:83 msgid "Warning: Device (%s) is unknown or isn't a dual-partition device!" @@ -200,4 +210,4 @@ msgstr "" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:141 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:142 msgid "to" -msgstr "" +msgstr "a" diff --git a/applications/luci-app-advanced-reboot/po/vi/advanced-reboot.po b/applications/luci-app-advanced-reboot/po/vi/advanced-reboot.po index c721384da5..7d789ae604 100644 --- a/applications/luci-app-advanced-reboot/po/vi/advanced-reboot.po +++ b/applications/luci-app-advanced-reboot/po/vi/advanced-reboot.po @@ -1,111 +1,117 @@ msgid "" msgstr "" +"PO-Revision-Date: 2019-11-13 13:08+0000\n" +"Last-Translator: Le Van Uoc <kunkun3012@gmail.com>\n" +"Language-Team: Vietnamese <https://hosted.weblate.org/projects/openwrt/" +"luciapplicationsadvanced-reboot/vi/>\n" "Language: vi\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.10-dev\n" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:29 msgid "Action" -msgstr "" +msgstr "Hành động" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:83 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:10 msgid "Advanced Reboot" -msgstr "" +msgstr "Khởi động nâng cao" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:36 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:60 msgid "Alternative" -msgstr "" +msgstr "Thay thế" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:24 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:20 msgid "Cancel" -msgstr "" +msgstr "Hủy bỏ" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:42 msgid "Changes applied." -msgstr "" +msgstr "Các thay đổi đã được áp dụng." #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:10 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:10 msgid "Confirm" -msgstr "" +msgstr "Xác nhận" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:36 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:60 msgid "Current" -msgstr "" +msgstr "Hiện tại" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:18 msgid "ERROR:" -msgstr "" +msgstr "Lỗi:" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:28 msgid "Firmware/OS (Kernel)" -msgstr "" +msgstr "Bộ nạp khởi động" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:45 msgid "Loading" -msgstr "" +msgstr "Đang tải" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:114 msgid "No access to fw_printenv or fw_printenv!" -msgstr "" +msgstr "Không thể truy cập tới fw_printenv!" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:26 msgid "Partition" -msgstr "" +msgstr "Phân vùng" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:23 msgid "Partitions" -msgstr "" +msgstr "Phân vùng" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:94 msgid "Perform power off..." -msgstr "" +msgstr "Thực hiện tắt nguồn..." #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:10 msgid "Power Off Device" -msgstr "" +msgstr "Tắt nguồn thiết bị" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:25 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:21 msgid "Proceed" -msgstr "" +msgstr "Tiến trình" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:10 msgid "Reboot Device to an Alternative Partition" -msgstr "" +msgstr "Khởi động lại thiết bị vào phân vùng thay thế" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:50 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:74 msgid "Reboot to alternative partition..." -msgstr "" +msgstr "Đang khởi động vào phân vùng thay thế..." #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:45 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:69 msgid "Reboot to current partition" -msgstr "" +msgstr "Khởi động lại vào phần vùng hiện tại" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:93 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:165 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:9 #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:39 msgid "Rebooting..." -msgstr "" +msgstr "Đang khởi động lại..." #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:199 msgid "Shutting down..." -msgstr "" +msgstr "Đang tắt nguồn..." #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:27 msgid "Status" -msgstr "" +msgstr "Trạng thái" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:39 msgid "System" -msgstr "" +msgstr "Hệ thống" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:94 msgid "" @@ -114,6 +120,10 @@ msgid "" "address of your computer to reach the device again, depending on your " "settings." msgstr "" +"Hệ thống sẽ được khởi động lại ngay.<br /> VUI LÒNG KHÔNG TẮT NGUỒN THIẾT " +"BỊ!<br /> Vui lòng chờ một vài phút trước khi thử kết nối lại. Bạn có thể " +"cần phải cập nhật lại địa chỉ máy tính để kết nối lại với thiết bị, phụ " +"thuộc vào cài đặt máy tính." #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:166 msgid "" @@ -122,6 +132,10 @@ msgid "" "might be necessary to renew the address of your computer to reach the device " "again, depending on your settings." msgstr "" +"Hệ thống sẽ được khởi động lại vào phân vùng thay thế ngay.<br /> VUI LÒNG " +"KHÔNG TẮT NGUỒN THIẾT BỊ!<br /> Vui lòng chờ một vài phút trước khi thử kết " +"nối lại. Bạn có thể cần phải cập nhật lại địa chỉ máy tính để kết nối lại " +"với thiết bị, phụ thuộc vào cài đặt máy tính." #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:200 msgid "" @@ -129,32 +143,35 @@ msgid "" "might be necessary to renew the address of your computer to reach the device " "again, depending on your settings." msgstr "" +"Hệ thống sẽ được tắt nguồn ngay.<br /> VUI LÒNG KHÔNG TẮT NGUỒN THIẾT BỊ!<br " +"/> Bạn có thể cần phải cập nhật lại địa chỉ máy tính để kết nối lại với " +"thiết bị, phụ thuộc vào cài đặt máy tính." #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:68 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:69 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:149 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:150 msgid "Unable to find Dual Boot Flag Partition." -msgstr "" +msgstr "Không tìm thấy phân vùng khởi động kép." #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:121 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:122 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:135 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:136 msgid "Unable to obtain firmware environment variable" -msgstr "" +msgstr "Không thể lấy được biến bộ nạp khởi động" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:157 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:158 msgid "Unable to set Dual Boot Flag Partition entry for partition" -msgstr "" +msgstr "Không thể cài phân vùng khởi động kép" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:127 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:128 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:141 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:142 msgid "Unable to set firmware environment variable" -msgstr "" +msgstr "Không thể cài biến môi trường khởi động" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:12 msgid "" @@ -177,27 +194,29 @@ msgstr "" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/applyreboot.htm:46 msgid "Waiting for changes to be applied..." -msgstr "" +msgstr "Vui lòng chờ để áp dụng các thay đổi..." #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:83 msgid "Warning: Device (%s) is unknown or isn't a dual-partition device!" msgstr "" +"Cảnh báo: Không thể nhận diện thiết bị (%s) hoặc không phải là thiết bị có " +"hai phân vùng!" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:14 msgid "Warning: There are unsaved changes that will get lost on reboot!" -msgstr "" +msgstr "Cảnh báo: Những thay đổi chưa được lưu sẽ bị xóa khi khởi động lại!" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:97 msgid "Warning: This system does not support powering off!" -msgstr "" +msgstr "Cảnh báo: Hệ thống không hỗ trợ việc tắt nguồn!" #: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:85 msgid "Warning: Unable to obtain device information!" -msgstr "" +msgstr "Cảnh báo: Không lấy được thông tin thiết bị!" #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:127 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:128 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:141 #: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:142 msgid "to" -msgstr "" +msgstr "đến" diff --git a/applications/luci-app-advanced-reboot/root/etc/uci-defaults/40_luci-advanced-reboot b/applications/luci-app-advanced-reboot/root/etc/uci-defaults/40_luci-advanced-reboot new file mode 100644 index 0000000000..e1a8f1e307 --- /dev/null +++ b/applications/luci-app-advanced-reboot/root/etc/uci-defaults/40_luci-advanced-reboot @@ -0,0 +1,5 @@ +#!/bin/sh + +rm -rf /var/luci-modulecache/; rm -f /var/luci-indexcache; +exit 0 + |