summaryrefslogtreecommitdiffstats
path: root/.local/bin/hddumnt
diff options
context:
space:
mode:
authorJoe <bousset.rudy@gmail.com>2022-06-26 21:33:40 +0200
committerJoe <bousset.rudy@gmail.com>2022-06-26 21:33:40 +0200
commit433c1067a166d88cef7d1c12cc0c6180bf497f47 (patch)
tree6c7e219c6654ebd5e4550f908629aff7de00b209 /.local/bin/hddumnt
parentComfort update (diff)
downloaddotfiles-bsd-433c1067a166d88cef7d1c12cc0c6180bf497f47.tar.gz
dotfiles-bsd-433c1067a166d88cef7d1c12cc0c6180bf497f47.tar.bz2
dotfiles-bsd-433c1067a166d88cef7d1c12cc0c6180bf497f47.tar.xz
dotfiles-bsd-433c1067a166d88cef7d1c12cc0c6180bf497f47.tar.zst
dotfiles-bsd-433c1067a166d88cef7d1c12cc0c6180bf497f47.zip
update
Diffstat (limited to '.local/bin/hddumnt')
-rwxr-xr-x.local/bin/hddumnt12
1 files changed, 10 insertions, 2 deletions
diff --git a/.local/bin/hddumnt b/.local/bin/hddumnt
index d81d969..4a883f7 100755
--- a/.local/bin/hddumnt
+++ b/.local/bin/hddumnt
@@ -1,5 +1,13 @@
#!/bin/sh -e
-umount /dev/da0.eli
-geli detach da0.eli
+if ! mount | grep -F /dev/da0p1; then
+ notify-send -u critical 'fathdd' ' HDD not mounted'
+ exit 1
+fi
+if ! umount /dev/da0p1.eli; then
+ notify-send -u critical 'fathdd' ' Failed to dismount HDD'
+ exit 1
+fi
+geli detach da0p1.eli
rmdir "$HOME"/hdd
+notify-send -t 5000 'fathdd' ' HDD dismounted from <b>~/hdd</b>'