1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

upload2usb.php add 'grep media' to device filter

This commit is contained in:
Jerry Vonau 2025-02-12 13:28:05 -06:00
parent bd8c131ef6
commit ebceb4a6ac

View file

@ -18,7 +18,7 @@ function getTargetUSBDriveLocation () {
// lsblk --output NAME,TRAN,RM,MOUNTPOINT --pairs |grep RM=\"1\" | grep -v MOUNTPOINT=\"\" | cut -d " " -f 4 | cut -d "=" -f 2
# error if 1<>usb sticks are installed
$rmv_usb_path_count = shell_exec('lsblk --output NAME,TRAN,RM,MOUNTPOINT --pairs |grep RM=\"1\" | grep -v MOUNTPOINT=\"\" | cut -d " " -f 4 | wc -l');
$rmv_usb_path_count = shell_exec('lsblk --output NAME,TRAN,RM,MOUNTPOINT --pairs |grep RM=\"1\" | grep -v MOUNTPOINT=\"\" | cut -d " " -f 4 | grep media | wc -l');
if ($rmv_usb_path_count == 0) {
throw new RuntimeException('0 USB sticks found. <br/><br/>');
} elseif ($rmv_usb_path_count > 1) {