summaryrefslogtreecommitdiffstats
path: root/src/bin/mddc-del-block-sym
diff options
context:
space:
mode:
authorPS <p@0x53.net>2026-02-01 12:10:12 +0100
committerPS <p@0x53.net>2026-02-01 12:10:12 +0100
commit049d80ae0e2b5f6370411207ed27fe423f5ff451 (patch)
tree4cdb7da70fff54ef52bd1d0a496d112b9ab19b2c /src/bin/mddc-del-block-sym
downloadmdevd-conf-049d80ae0e2b5f6370411207ed27fe423f5ff451.tar.gz
mdevd-conf-049d80ae0e2b5f6370411207ed27fe423f5ff451.tar.bz2
mdevd-conf-049d80ae0e2b5f6370411207ed27fe423f5ff451.zip
version 0.1.0.0
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}