diff --git a/bin/lmount b/bin/lmount new file mode 100755 index 0000000..a5bc18c --- /dev/null +++ b/bin/lmount @@ -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 " + + 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 " + + exit 1 +fi + +# Mounts an encrypt external drive to a specified mount point +cryptsetup luksOpen $1 external +mount /dev/mapper/external $2 diff --git a/bin/lumount b/bin/lumount new file mode 100755 index 0000000..da87254 --- /dev/null +++ b/bin/lumount @@ -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 " + + 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 " + + exit 1 +fi + +# Mounts an encrypt external drive to a specified mount point +umount $1 +cryptsetup luksClose external