summaryrefslogtreecommitdiffstats
path: root/src/bin/mddc-del-block-sym
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/mddc-del-block-sym')
-rwxr-xr-xsrc/bin/mddc-del-block-sym14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bin/mddc-del-block-sym b/src/bin/mddc-del-block-sym
new file mode 100755
index 0000000..caa4ce9
--- /dev/null
+++ b/src/bin/mddc-del-block-sym
@@ -0,0 +1,14 @@
+#!@shebangdir@/execlineb -P
+
+importas -Si MDEV
+
+if -x0 { eltest -d /sys/block/${MDEV} }
+if -x0 { eltest -d /dev/disk }
+
+pipeline { ls -1 /dev/disk }
+forstdin -pE TYPE
+ pipeline { ls -1 /dev/disk/${TYPE} }
+ forstdin -pE SYM
+ backtick -E RPATH { realpath /dev/disk/${TYPE}/${SYM} }
+ if { eltest ${RPATH} =~ /dev/${MDEV}.* }
+ rm -f /dev/disk/${TYPE}/${SYM}