summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-admin-full/luasrc/view/admin_system
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2018-05-15 11:35:40 +0200
committerJo-Philipp Wich <jo@mein.io>2018-07-03 17:45:12 +0200
commit65ba4b8b8ae21fde49d0636bc1398940522322ff (patch)
tree393e8221a8a9d5178b668ff5bb296a4857cb4b8e /modules/luci-mod-admin-full/luasrc/view/admin_system
parentddbde3caaae267d400316d584e90991a579250d7 (diff)
luci-mod-admin-full: check backup.tar.gz on apply
If an uploaded backup.tar.gz is not valid we will not get a respond from LuCI. The system will perform a reboot without applying the "tar.gz" even though the backup import failed. To fix this check if the backup archive is valid with the command "gunzip -t <archive>" and if the validation fails render the flashops page with a hint. On the other hand apply the backup archive and perform a reboot as before. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'modules/luci-mod-admin-full/luasrc/view/admin_system')
-rw-r--r--modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm b/modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm
index 0a4bc6578c..f90a6f5424 100644
--- a/modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm
+++ b/modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm
@@ -50,9 +50,12 @@
</div>
</div>
</form>
+ <% if backup_invalid then %>
+ <div class="cbi-section-error"><%:The backup archive does not appear to be a valid gzip file.%></div>
+ <% end %>
</div>
<% if reset_avail then %>
- <div class="alert-message warning"><%:Custom files (certificates, scripts) may remain on the system. To prevent this, perform a factory-reset first.%></div>
+ <div class="alert-message warning"><%:Custom files (certificates, scripts) may remain on the system. To prevent this, perform a factory-reset first.%></div>
<% end %>
</div>