Easy mount/umount luks encrypted partitions
This commit is contained in:
parent
611ab5791f
commit
ec14c1c073
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ "$#" -ne 2 ]; then
|
||||||
|
echo -e >&2 "\x1B[1;31merror:\x1B[0;1m this program expects two arguments\x1B[0m"
|
||||||
|
echo -e >&2 "\x1B[1;33musage:\x1B[0;1m sudo lmount <drive> <mount point>"
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$USER" != "root" ]; then
|
||||||
|
echo -e >&2 "\x1B[1;31merror:\x1B[0;1m this program must be run as root\x1B[0m"
|
||||||
|
echo -e >&2 "\x1B[1;33musage:\x1B[0;1m sudo lmount <drive> <mount point>"
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Mounts an encrypt external drive to a specified mount point
|
||||||
|
cryptsetup luksOpen $1 external
|
||||||
|
mount /dev/mapper/external $2
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ "$#" -ne 1 ]; then
|
||||||
|
echo -e >&2 "\x1B[1;31merror:\x1B[0;1m this program expects one argument\x1B[0m"
|
||||||
|
echo -e >&2 "\x1B[1;33musage:\x1B[0;1m sudo lumount <mount point>"
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$USER" != "root" ]; then
|
||||||
|
echo -e >&2 "\x1B[1;31merror:\x1B[0;1m this program must be run as root\x1B[0m"
|
||||||
|
echo -e >&2 "\x1B[1;33musage:\x1B[0;1m sudo lumount <mount point>"
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Mounts an encrypt external drive to a specified mount point
|
||||||
|
umount $1
|
||||||
|
cryptsetup luksClose external
|
Loading…
Reference in New Issue