mirror of
https://github.com/unraid/webgui.git
synced 2026-05-03 16:29:45 -05:00
Use vfat check to validate flash device
This commit is contained in:
@@ -12,6 +12,16 @@
|
||||
?>
|
||||
<?
|
||||
switch ($_POST['cmd']) {
|
||||
case 'vfat':
|
||||
$check = "/var/tmp/check.vfat";
|
||||
if (!file_exists($check)) {
|
||||
$disks = parse_ini_file('/var/local/emhttp/disks.ini',true);
|
||||
file_put_contents($check,exec("lsblk -lo NAME /dev/{$disks['flash']['device']}|awk '(NR>2)'"));
|
||||
}
|
||||
$dev = file_get_contents($check);
|
||||
passthru("fsck.vfat -n /dev/$dev",$status);
|
||||
echo $status;
|
||||
break;
|
||||
case 'sha256':
|
||||
$boot = "/boot";
|
||||
$check = "/var/tmp/check.sha256";
|
||||
|
||||
Reference in New Issue
Block a user