dotfiles/dot_bin/executable_umount.veracrypt

16 lines
340 B
Plaintext
Raw Normal View History

2021-02-15 20:53:16 -05:00
#! /bin/bash
## unmount a veracrypt volume
## the funny evals are here to expand any literal env variables that may be
## passed because systemd didn't expand them (yuck)
mountpoint="$(eval echo "$1")"
if /usr/bin/sudo /usr/bin/veracrypt -d "$mountpoint"; then
echo "Unmounted $1"
else
echo "Failed to unmount $1"
exit 1
fi