mirror of
https://github.com/j-a-n/raspberrymatic-addon-rmupdate.git
synced 2023-10-10 13:37:40 +02:00
Delete downloaded firmware image after installation.
This commit is contained in:
parent
6c75f65b3d
commit
dd26628ea0
@ -1113,7 +1113,7 @@ proc ::rmupdate::delete_firmware_image {version} {
|
|||||||
catch { eval {file delete [glob "${img_dir}/*${version}*.zip"]} }
|
catch { eval {file delete [glob "${img_dir}/*${version}*.zip"]} }
|
||||||
}
|
}
|
||||||
|
|
||||||
proc ::rmupdate::install_firmware_version {version lang {reboot 1} {dryrun 0}} {
|
proc ::rmupdate::install_firmware_version {version lang {reboot 1} {keep_download 0} {dryrun 0}} {
|
||||||
variable language
|
variable language
|
||||||
set language $lang
|
set language $lang
|
||||||
if {[get_running_installation] != ""} {
|
if {[get_running_installation] != ""} {
|
||||||
@ -1142,6 +1142,10 @@ proc ::rmupdate::install_firmware_version {version lang {reboot 1} {dryrun 0}} {
|
|||||||
check_sizes $firmware_image
|
check_sizes $firmware_image
|
||||||
update_filesystems $firmware_image $dryrun
|
update_filesystems $firmware_image $dryrun
|
||||||
|
|
||||||
|
if {!$keep_download && !$dryrun} {
|
||||||
|
file delete $firmware_image
|
||||||
|
}
|
||||||
|
|
||||||
set_running_installation ""
|
set_running_installation ""
|
||||||
|
|
||||||
if {$reboot && !$dryrun} {
|
if {$reboot && !$dryrun} {
|
||||||
|
@ -217,9 +217,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
$('#modal-log').modal('show');
|
$('#modal-log').modal('show');
|
||||||
if (!running_installation) {
|
if (!running_installation) {
|
||||||
var reboot = $('#reboot-after-install').is(':checked');
|
var reboot = $('#reboot-after-install').is(':checked');
|
||||||
|
var keep_download = ! $('#delete-download-after-install').is(':checked');
|
||||||
var dryrun = $('#dryrun').is(':checked');
|
var dryrun = $('#dryrun').is(':checked');
|
||||||
set_running_installation("Firmware " + version);
|
set_running_installation("Firmware " + version);
|
||||||
rest("POST", "/start_install_firmware", JSON.stringify({"language": language, "version":version, "reboot":reboot, "dryrun":dryrun}),
|
rest("POST", "/start_install_firmware", JSON.stringify({"language": language, "version":version, "reboot":reboot, "dryrun":dryrun, "keep_download": keep_download}),
|
||||||
function(data) {
|
function(data) {
|
||||||
// We are not expecting a response
|
// We are not expecting a response
|
||||||
},
|
},
|
||||||
@ -580,6 +581,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
installation_log: 'Installation log',
|
installation_log: 'Installation log',
|
||||||
open_release_info: 'Open release info',
|
open_release_info: 'Open release info',
|
||||||
perform_trial_run: 'Perform a trial run with no changes made',
|
perform_trial_run: 'Perform a trial run with no changes made',
|
||||||
|
delete_download_after_install: 'Delete download after installation',
|
||||||
reboot_after_install: 'Reboot system after installation',
|
reboot_after_install: 'Reboot system after installation',
|
||||||
addons: 'Addons',
|
addons: 'Addons',
|
||||||
addon_name: 'Addon name',
|
addon_name: 'Addon name',
|
||||||
@ -648,6 +650,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
installation_log: 'Installations-Protokoll',
|
installation_log: 'Installations-Protokoll',
|
||||||
open_release_info: 'Release-Informationen öffnen',
|
open_release_info: 'Release-Informationen öffnen',
|
||||||
perform_trial_run: 'Testlauf durchführen ohne Änderungen durchzuführen',
|
perform_trial_run: 'Testlauf durchführen ohne Änderungen durchzuführen',
|
||||||
|
delete_download_after_install: 'Download nach Installation löschen',
|
||||||
reboot_after_install: 'System nach Installation neu starten',
|
reboot_after_install: 'System nach Installation neu starten',
|
||||||
addons: 'Zusatzsoftware',
|
addons: 'Zusatzsoftware',
|
||||||
addon_name: 'Name des Addons',
|
addon_name: 'Name des Addons',
|
||||||
@ -811,6 +814,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<label data-i18n="perform_trial_run"></label>
|
<label data-i18n="perform_trial_run"></label>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
<div class="ui checkbox">
|
||||||
|
<input id="delete-download-after-install" type="checkbox" checked="checked">
|
||||||
|
<label data-i18n="delete_download_after_install"></label>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
<div class="ui checkbox">
|
<div class="ui checkbox">
|
||||||
<input id="reboot-after-install" type="checkbox" checked="checked">
|
<input id="reboot-after-install" type="checkbox" checked="checked">
|
||||||
<label data-i18n="reboot_after_install"></label>
|
<label data-i18n="reboot_after_install"></label>
|
||||||
|
@ -70,6 +70,7 @@ proc process {} {
|
|||||||
regexp {\"language\"\s*:\s*\"([^\"]+)\"} $data match lang
|
regexp {\"language\"\s*:\s*\"([^\"]+)\"} $data match lang
|
||||||
regexp {\"reboot\"\s*:\s*(true|false)} $data match reboot
|
regexp {\"reboot\"\s*:\s*(true|false)} $data match reboot
|
||||||
regexp {\"dryrun\"\s*:\s*(true|false)} $data match dryrun
|
regexp {\"dryrun\"\s*:\s*(true|false)} $data match dryrun
|
||||||
|
regexp {\"keep_download\"\s*:\s*(true|false)} $data match keep_download
|
||||||
if { [info exists version] && $version != "" } {
|
if { [info exists version] && $version != "" } {
|
||||||
if { ![info exists reboot] } {
|
if { ![info exists reboot] } {
|
||||||
set reboot "true"
|
set reboot "true"
|
||||||
@ -79,7 +80,7 @@ proc process {} {
|
|||||||
} else {
|
} else {
|
||||||
set reboot 0
|
set reboot 0
|
||||||
}
|
}
|
||||||
if { ![info exists reboot] } {
|
if { ![info exists dryrun] } {
|
||||||
set dryrun "false"
|
set dryrun "false"
|
||||||
}
|
}
|
||||||
if {$dryrun == "true"} {
|
if {$dryrun == "true"} {
|
||||||
@ -87,7 +88,15 @@ proc process {} {
|
|||||||
} else {
|
} else {
|
||||||
set dryrun 0
|
set dryrun 0
|
||||||
}
|
}
|
||||||
return "\"[rmupdate::install_firmware_version $version $lang $reboot $dryrun]\""
|
if { ![info exists keep_download] } {
|
||||||
|
set keep_download "false"
|
||||||
|
}
|
||||||
|
if {$keep_download == "true"} {
|
||||||
|
set keep_download 1
|
||||||
|
} else {
|
||||||
|
set keep_download 0
|
||||||
|
}
|
||||||
|
return "\"[rmupdate::install_firmware_version $version $lang $reboot $keep_download $dryrun]\""
|
||||||
} else {
|
} else {
|
||||||
error "Invalid version: ${data}"
|
error "Invalid version: ${data}"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user