From d8914e231104dc1dc910bcd0ef2f7a4254c6729f Mon Sep 17 00:00:00 2001 From: hummypkg Date: Thu, 23 Feb 2012 22:06:39 +0000 Subject: [PATCH] enable cfw reset git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@762 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- var/mongoose/cgi-bin/cfwreset | 7 ------- var/mongoose/cgi-bin/cfwreset.cgi | 7 +++++++ var/mongoose/html/diag/diag.jim | 26 ++++++++++++++++++++++++-- var/mongoose/html/diag/script.js | 15 ++++++++++++++- 5 files changed, 46 insertions(+), 11 deletions(-) delete mode 100755 var/mongoose/cgi-bin/cfwreset create mode 100755 var/mongoose/cgi-bin/cfwreset.cgi diff --git a/CONTROL/control b/CONTROL/control index af68684e..2c74dd32 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 0.9.3-3 +Version: 0.9.3-4 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73),jim-cgi(>=0.5),service-control(>=1.2),busybox(>=1.19.3-1),lsof,epg(>=1.0.9),hmt(>=1.1.6),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2,file diff --git a/var/mongoose/cgi-bin/cfwreset b/var/mongoose/cgi-bin/cfwreset deleted file mode 100755 index 0507f8e6..00000000 --- a/var/mongoose/cgi-bin/cfwreset +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -echo "Content-Type: text/plain" -echo - -/bin/rm -rf /mod/* - diff --git a/var/mongoose/cgi-bin/cfwreset.cgi b/var/mongoose/cgi-bin/cfwreset.cgi new file mode 100755 index 00000000..9ebfce47 --- /dev/null +++ b/var/mongoose/cgi-bin/cfwreset.cgi @@ -0,0 +1,7 @@ +#!/bin/sh + +echo "Content-Type: text/plain" +echo + +touch /var/lib/humaxtv/mod/_RESET_CUSTOM_FIRMWARE_ENVIRONMENT + diff --git a/var/mongoose/html/diag/diag.jim b/var/mongoose/html/diag/diag.jim index 85e7c392..269ee941 100755 --- a/var/mongoose/html/diag/diag.jim +++ b/var/mongoose/html/diag/diag.jim @@ -43,12 +43,34 @@ puts { - +} + +if {[system modversion 1] < 200} { + puts {
-(This option will return with firmware 2.00) +(Install custom firmware v2.00 to enable this option)
+ } +} + +puts { + + + diff --git a/var/mongoose/html/diag/script.js b/var/mongoose/html/diag/script.js index 6497f9d9..0f3f8d77 100644 --- a/var/mongoose/html/diag/script.js +++ b/var/mongoose/html/diag/script.js @@ -39,7 +39,20 @@ $('#runedit').click(function(e) { window.location = '/edit/edit.jim'; }); -$('#runreset').disable(); +$('#runreset').click(function(e) { + e.preventDefault(); + if (!confirm('Are you sure? This will completely remove all packages and settings.')) + return; + if (!confirm('Are you really sure?')) + return; + if (!confirm('One last time, are you sure?')) + return; + $.get('/cgi-bin/cfwreset.cgi', function() { + $('button').disable(); + $('#resetdone').slideDown(); + }); +}); }); +