Use vfat check to validate flash device

This commit is contained in:
bergware
2021-08-22 16:31:27 +02:00
parent c3a4197e93
commit 4ba014c7bc
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -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";