mirror of
https://github.com/unraid/webgui.git
synced 2026-01-26 03:29:08 -06:00
VM Manager: check free space before attempting to download OpenELEC file
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user