mirror of
https://github.com/unraid/webgui.git
synced 2026-05-04 00:39:32 -05:00
TRIM: fix is_hdd logic
This commit is contained in:
@@ -47,7 +47,8 @@ function write(...$messages){
|
||||
}
|
||||
|
||||
function is_hdd($disk) {
|
||||
$disk = explode('/',$disk)[-1];
|
||||
$disk = explode('/',$disk);
|
||||
$disk = preg_replace('/^(sd[a-z]+|nvme[0-9]+n1)p?1$/','$1',end($disk));
|
||||
return file_get_contents("/sys/block/$disk/queue/rotational")==1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user