VM Manager: check free space before attempting to download OpenELEC file

This commit is contained in:
Eric Schultz
2016-06-29 20:45:27 -05:00
parent 86404fa088
commit 5315b21eb2

View File

@@ -88,6 +88,15 @@
@mkdir($_POST['download_path'], 0777, true);
$_POST['download_path'] = realpath($_POST['download_path']) . '/';
// Check free space
if (disk_free_space($_POST['download_path']) < $arrDownloadOpenELEC['size']+10000) {
$arrResponse = [
'error' => 'Not enough free space, need at least ' . ceil($arrDownloadOpenELEC['size']/1000000).'MB'
];
echo json_encode($arrResponse);
exit;
}
$boolCheckOnly = !empty($_POST['checkonly']);
$strInstallScript = '/tmp/OpenELEC_' . $_POST['download_version'] . '_install.sh';