diff options
-rwxr-xr-x | mount_crypt | 9 | ||||
-rwxr-xr-x | umount_crypt | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/mount_crypt b/mount_crypt index d4a6bc4..dc1d59d 100755 --- a/mount_crypt +++ b/mount_crypt @@ -3,6 +3,11 @@ . /home/pks/bin/func.zsh check_root -cryptsetup luksOpen /dev/disk/by-id/scsi-SATA_WDC_WD1002FAEX-_WD-WCAW32441082-part1 remote_backup -mount /dev/mapper/remote_backup /mnt/ +if [ "$#" -ne 2 ]; then + echo "missing args." + exit +fi + +cryptsetup luksOpen $1 $2 +mount /dev/mapper/$2 diff --git a/umount_crypt b/umount_crypt index 54f7cc0..a2bfbfb 100755 --- a/umount_crypt +++ b/umount_crypt @@ -3,6 +3,11 @@ . /home/pks/bin/func.zsh check_root -umount /mnt -cryptsetup luksClose /dev/mapper/remote_backup +if [ "$#" -ne 2 ]; then + echo "missing arg." + exit +fi + +umount $2 +cryptsetup luksClose /dev/mapper/$1 |