diff options
Diffstat (limited to 'applications/luci-app-advanced-reboot')
4 files changed, 242 insertions, 10 deletions
diff --git a/applications/luci-app-advanced-reboot/Makefile b/applications/luci-app-advanced-reboot/Makefile index 08919640d7..eceb15b09b 100644 --- a/applications/luci-app-advanced-reboot/Makefile +++ b/applications/luci-app-advanced-reboot/Makefile @@ -8,12 +8,12 @@ PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net> LUCI_TITLE:=Advanced Linksys Reboot Web UI LUCI_DESCRIPTION:=Provides Web UI (found under System/Advanced Reboot) to reboot supported Linksys and ZyXEL routers to\ - an altnerative partition. Also provides Web UI to shut down (power off) your device. Supported dual-partition\ + an alternative partition. Also provides Web UI to shut down (power off) your device. Supported dual-partition\ routers are listed at https://github.com/stangri/openwrt-luci/blob/luci-app-advanced-reboot/applications/luci-app-advanced-reboot/README.md LUCI_DEPENDS:=+luci-mod-admin-full LUCI_PKGARCH:=all -PKG_RELEASE:=33 +PKG_RELEASE:=39 include ../../luci.mk diff --git a/applications/luci-app-advanced-reboot/README.md b/applications/luci-app-advanced-reboot/README.md index 7ed1826eac..781a1c7f70 100644 --- a/applications/luci-app-advanced-reboot/README.md +++ b/applications/luci-app-advanced-reboot/README.md @@ -1,13 +1,17 @@ # Advanced Reboot Web UI (luci-app-advanced-reboot) ## Description + This package allows you to reboot to an alternative partition on the supported (dual-partition) routers and to power off (power down) your OpenWrt device. ## Supported Devices + Currently supported dual-partition devices include: + - Linksys EA3500 - Linksys E4200v2 - Linksys EA4500 +- Linksys EA6350v3 - Linksys EA8500 - Linksys WRT1200AC - Linksys WRT1900AC @@ -20,19 +24,24 @@ Currently supported dual-partition devices include: 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). ## Screenshot (luci-app-advanced-reboot) + ![screenshot](https://raw.githubusercontent.com/stangri/openwrt_packages/master/screenshots/luci-app-advanced-reboot/screenshot01.png "screenshot") ## How to install + Install ```luci-app-advanced-reboot``` from Web UI or connect to your router via ssh and run the following commands: + ```sh opkg update opkg install luci-app-advanced-reboot ``` ## Notes/Known Issues + - When you reboot to a different partition, your current settings (WiFi SSID/password, etc.) will not apply to a different partition. Different partitions might have completely different settings and even firmware. - If you reboot to a partition which doesn't allow you to switch boot partitions (like stock vendor firmware), you might not be able to boot back to OpenWrt unless you reflash it, losing all the settings. - Some devices allow you to trigger reboot to an alternative partition by interrupting boot 3 times in a row (by resetting/switching off the device or pulling power). As these methods might be different for different devices, do your own homework. ## Thanks -I'd like to thank everyone who helped create, test and troubleshoot this package. Without help from [@hnyman](https://github.com/hnyman), [@jpstyves](https://github.com/jpstyves) and many contributions from [@slh](https://github.com/pkgadd) it wouldn't have been possible. + +I'd like to thank everyone who helped create, test and troubleshoot this package. Without help from [@hnyman](https://github.com/hnyman), [@jpstyves](https://github.com/jpstyves), [@imi2003](https://github.com/imi2003) and many contributions from [@slh](https://github.com/pkgadd) it wouldn't have been possible. 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 dd8071677e..f40eac50c3 100644 --- a/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua +++ b/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua @@ -7,6 +7,7 @@ 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 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"}, @@ -34,11 +35,11 @@ for i=1, #devices do 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=25" .. " 2>/dev/null")) + 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=25" .. " 2>/dev/null")) + 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 @@ -63,7 +64,7 @@ for i=1, #devices do 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 .. luci.i18n.translate("Unable to find Dual Boot Flag Partition." .. " ") + 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\"'")) @@ -121,7 +122,7 @@ function action_altreboot() 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 .. luci.i18n.translate("Unable to set firmware environment variable") .. ": " .. boot_envvar1 .. " " .. luci.i18n.translate("to") .. " " .. newEnvSetting .. ". " + 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 @@ -129,13 +130,13 @@ function action_altreboot() if boot_envvar2 then curEnvSetting = luci.util.trim(luci.sys.exec("/usr/sbin/fw_printenv -n " .. boot_envvar2)) if not curEnvSetting then - errorMessage = errorMessage .. luci.i18n.translate("Unable to obtain firmware environment variable") .. ": " .. boot_envvar2 .. ". " + 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 .. luci.i18n.translate("Unable to set firmware environment variable") .. ": " .. boot_envvar2 .. " " .. luci.i18n.translate("to") .. " " .. newEnvSetting .. ". " + 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 @@ -151,7 +152,7 @@ function action_altreboot() if zyxelNewBootFlag then errorCode = luci.sys.call("printf \"" .. zyxelNewBootFlag .. "\" >" .. zyxelFlagPartition ) if errorCode ~= 0 then - errorMessage = errorMessage .. luci.i18n.translate("Unable to set Dual Boot Flag Partition entry for partition") .. ": " .. zyxelFlagPartition .. ". " + 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 diff --git a/applications/luci-app-advanced-reboot/po/es/advanced-reboot.po b/applications/luci-app-advanced-reboot/po/es/advanced-reboot.po new file mode 100644 index 0000000000..bb669c88ce --- /dev/null +++ b/applications/luci-app-advanced-reboot/po/es/advanced-reboot.po @@ -0,0 +1,222 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2.1\n" +"Last-Translator: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: es\n" + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:29 +msgid "Action" +msgstr "Acción" + +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:81 +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:10 +msgid "Advanced Reboot" +msgstr "Reinicio avanzado" + +#: 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 "Alternativo" + +#: 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 "Cancelar" + +#: 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 "Confirmar" + +#: 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 "Actual" + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:18 +msgid "ERROR:" +msgstr "ERROR:" + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:28 +msgid "Firmware/OS (Kernel)" +msgstr "Firmware" + +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:111 +msgid "No access to fw_printenv or fw_printenv!" +msgstr "Sin acceso a fw_printenv o fw_printenv!" + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:26 +msgid "Partition" +msgstr "Partición" + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:23 +msgid "Partitions" +msgstr "Particiones" + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:94 +msgid "Perform power off..." +msgstr "Realizar apagado..." + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:10 +msgid "Power Off Device" +msgstr "Apagar dispositivo..." + +#: 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 "Proceder" + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:10 +msgid "Reboot Device to an Alternative Partition" +msgstr "Reinicie el dispositivo a una partición alternativa" + +#: 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 "Reiniciar a partición alternativa ..." + +#: 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 "Reiniciar a la partición actual" + +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:90 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:162 +msgid "Rebooting..." +msgstr "Reiniciando..." + +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:196 +msgid "Shutting down..." +msgstr "Apagando..." + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:27 +msgid "Status" +msgstr "Estado" + +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:91 +msgid "" +"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." +msgstr "" +"El sistema se está reiniciando ahora.<br /> ¡NO APAGUE EL DISPOSITIVO!<br /> " +"Espere unos minutos antes de intentar volver a conectarse. Es posible que " +"sea necesario renovar la dirección de su computadora para llegar al " +"dispositivo nuevamente, dependiendo de su configuración." + +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:163 +msgid "" +"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." +msgstr "" +"El sistema se está reiniciando en una partición alternativa ahora.<br /> ¡NO " +"APAGUE EL DISPOSITIVO!<br /> Espere unos minutos antes de intentar volver a " +"conectarse. Es posible que sea necesario renovar la dirección de su " +"computadora para llegar al dispositivo nuevamente, dependiendo de su " +"configuración." + +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:197 +msgid "" +"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." +msgstr "" +"El sistema se está apagando ahora.<br /> ¡NO APAGUE EL DISPOSITIVO!<br /> " +"Puede que sea necesario renovar la dirección de su computadora para llegar " +"al dispositivo nuevamente, dependiendo de la configuración." + +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:66 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:67 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:146 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:147 +msgid "Unable to find Dual Boot Flag Partition." +msgstr "No se puede encontrar la partición de bandera de arranque dual." + +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:118 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:119 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:132 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:133 +msgid "Unable to obtain firmware environment variable" +msgstr "No se puede obtener la variable de entorno de firmware" + +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:154 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:155 +msgid "Unable to set Dual Boot Flag Partition entry for partition" +msgstr "" +"No se puede establecer la entrada de la partición del indicador de inicio " +"dual para la partición" + +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:124 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:125 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:138 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:139 +msgid "Unable to set firmware environment variable" +msgstr "No se puede establecer la variable de entorno de firmware" + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:12 +msgid "" +"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 /> Click \"Proceed\" below " +"to reboot device to an alternative partition." +msgstr "" +"ADVERTENCIA: Una partición alternativa puede tener su propia configuración y " +"un firmware completamente diferente.<br /><br /> Como la configuración de su " +"red y el SSID/contraseña WiFi en la partición alternativa pueden ser " +"diferentes, es posible que tenga que ajustar la configuración de su " +"computadora para poder para acceder a su dispositivo una vez que se reinicie." +"<br /><br /> También tenga en cuenta que un firmware de partición " +"alternativo podría no proporcionar una manera fácil de cambiar la partición " +"activa y volver a iniciar la partición activa.<br /><br /> Haga clic en " +"\"Continuar\" a continuación para reiniciar el dispositivo a una partición " +"alternativa." + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:12 +msgid "" +"WARNING: Power off might result in a reboot on a device which doesn't " +"support power off.<br /><br /> Click \"Proceed\" below to power off your " +"device." +msgstr "" +"ADVERTENCIA: el apagado puede ocasionar el reinicio de un dispositivo que no " +"es compatible con el apagado.<br /><br /> Haga clic en \"Continuar\" a " +"continuación para apagar su dispositivo." + +#: 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 "" +"Advertencia: ¡El dispositivo (%s) es desconocido o no es un dispositivo de " +"doble partición!" + +#: 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 "Advertencia: ¡Hay cambios no guardados que se perderán al reiniciar!" + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:97 +msgid "Warning: This system does not support powering off!" +msgstr "Advertencia: ¡Este sistema no admite el apagado!" + +#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:85 +msgid "Warning: Unable to obtain device information!" +msgstr "Advertencia: ¡No se puede obtener información del dispositivo!" + +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:124 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:125 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:138 +#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:139 +msgid "to" +msgstr "a" |