From a816daa384dd754b7586f51157fc2e1a44e76073 Mon Sep 17 00:00:00 2001 From: Immae Date: Sat, 20 Apr 2024 21:54:20 +0200 Subject: [PATCH] Allow more ways to detect disk to deactivate --- disk-deactivate/disk-deactivate.jq | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/disk-deactivate/disk-deactivate.jq b/disk-deactivate/disk-deactivate.jq index 8ac9abf3..6e444039 100644 --- a/disk-deactivate/disk-deactivate.jq +++ b/disk-deactivate/disk-deactivate.jq @@ -69,7 +69,10 @@ def walk: def init: "/dev/\(.name)" as $disk | - if $disk == $disk_to_clear then + "/dev/disk/by-id/\(."id-link")" as $disk_by_id | + "/dev/disk/by-id/\(.tran)-\(.id)" as $disk_by_id2 | + "/dev/disk/by-id/\(.tran)-\(.wwn)" as $disk_by_wwn | + if $disk == $disk_to_clear or $disk_by_id == $disk_to_clear or $disk_by_id2 == $disk_to_clear or $disk_by_wwn == $disk_to_clear then [ "set -fu", walk