summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/fathddmnt21
-rwxr-xr-x.local/bin/fathddumnt13
-rwxr-xr-x.local/bin/hddmnt23
-rwxr-xr-x.local/bin/hddumnt12
4 files changed, 28 insertions, 41 deletions
diff --git a/.local/bin/fathddmnt b/.local/bin/fathddmnt
deleted file mode 100755
index 62bfff6..0000000
--- a/.local/bin/fathddmnt
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh -e
-
-if ! diskinfo da0 >/dev/null; then
- notify-send -u critical 'fathdd' ' HDD not detected'
- exit 1
-fi
-if mount | grep -F /dev/da0p1; then
- notify-send -u critical \
- 'fathdd' \
- " HDD already mounted to \
-<b>$(mount | grep -F '/dev/da0p1' | awk '{print $3}')</b>"
- exit 1
-fi
-if ! dmenu -p 'Enter password: ' -P |
- geli attach -k /root/geli_keys/fathdd_ext.key -j - da0p1; then
- notify-send -u critical 'fathdd' ' Failed to mount HDD'
- exit 1
-fi
-mkdir -p "$HOME"/hdd
-mount /dev/da0p1.eli "$HOME"/hdd
-notify-send -t 5000 'fathdd' ' HDD mounted to <b>~/hdd</b>'
diff --git a/.local/bin/fathddumnt b/.local/bin/fathddumnt
deleted file mode 100755
index 4a883f7..0000000
--- a/.local/bin/fathddumnt
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh -e
-
-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>'
diff --git a/.local/bin/hddmnt b/.local/bin/hddmnt
index 242f4d0..62bfff6 100755
--- a/.local/bin/hddmnt
+++ b/.local/bin/hddmnt
@@ -1,8 +1,21 @@
#!/bin/sh -e
-tmp=$(mktemp)
-
-dmenu -p "Enter password: " -nb '#1d2021' -nf '#1d2021' <&- >"$tmp"
-geli attach -k /root/geli_keys/hdd_ext.key -j "$tmp" /dev/da0
+if ! diskinfo da0 >/dev/null; then
+ notify-send -u critical 'fathdd' ' HDD not detected'
+ exit 1
+fi
+if mount | grep -F /dev/da0p1; then
+ notify-send -u critical \
+ 'fathdd' \
+ " HDD already mounted to \
+<b>$(mount | grep -F '/dev/da0p1' | awk '{print $3}')</b>"
+ exit 1
+fi
+if ! dmenu -p 'Enter password: ' -P |
+ geli attach -k /root/geli_keys/fathdd_ext.key -j - da0p1; then
+ notify-send -u critical 'fathdd' ' Failed to mount HDD'
+ exit 1
+fi
mkdir -p "$HOME"/hdd
-mount /dev/da0.eli "$HOME"/hdd
+mount /dev/da0p1.eli "$HOME"/hdd
+notify-send -t 5000 'fathdd' ' HDD mounted to <b>~/hdd</b>'
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>'