diff options
Diffstat (limited to 'bin/executable_wd-umount')
-rw-r--r-- | bin/executable_wd-umount | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/executable_wd-umount b/bin/executable_wd-umount new file mode 100644 index 0000000..51a11e1 --- /dev/null +++ b/bin/executable_wd-umount @@ -0,0 +1,21 @@ +#!/bin/sh + +case `uname` in + OpenBSD) + doas umount /mnt/wd + doas bioctl -d 79665ba14a5187ba + ;; + Linux) + if zpool list wd-pass > /dev/null 2>&1; then + if mount -l | grep -E '^/var/lib/mpd/music '; then + sudo umount --lazy -f /var/lib/mpd/music + fi + mount -l -t zfs | IFS=' on ' awk '{ print $1 }' | sudo xargs -I '{}' zfs umount -u '{}' + sudo zpool export wd-pass + fi + ;; + *) + echo "Unknown host" + exit 1 + ;; +esac |