From 45caf8984e2d12364b3e810174e660a312fe4750 Mon Sep 17 00:00:00 2001 From: Christopher Spinrath Date: Tue, 17 Jul 2018 11:01:04 +0200 Subject: [PATCH] =?UTF-8?q?VeraCrypt:=20f=C3=BCge=20Beispiel-Skript=20zum?= =?UTF-8?q?=20Mounten=20hinzu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- veracrypt/verausbdrive.sh.example | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 veracrypt/verausbdrive.sh.example diff --git a/veracrypt/verausbdrive.sh.example b/veracrypt/verausbdrive.sh.example new file mode 100755 index 0000000..5646dca --- /dev/null +++ b/veracrypt/verausbdrive.sh.example @@ -0,0 +1,39 @@ +#!/bin/bash + +######################################################## +# Configuration +######################################################## + +USB_DRIVE_PART_NAME="KINGSTON" +VERA_DRIVE_NAME="NO NAME" +VERA_CONTAINER_PATH_REL="VERSCHLUESSELT/GTIKlausuren" + +MOUNT_PATH="/Volumes/" + +PYTHON_VERA_WRAPPER_BIN=~/ls1-misc/veracrypt/verausbdrive.py + +######################################################## + +set -e + +USB_DRIVE_MOUNT_PATH="$MOUNT_PATH/$USB_DRIVE_PART_NAME" +VERA_MOUNT_PATH="$MOUNT_PATH/$VERA_DRIVE_NAME" + +if [ ! -d "$USB_DRIVE_MOUNT_PATH" ] +then + echo "USB drive partition not mounted; ignoring request." + exit 0 +fi + +if [ -d "$VERA_MOUNT_PATH" ] +then + echo "Verascript drive name already in use; assuming the container is already mounted." + exit 0 +fi + +MY_BASEPATH="$(dirname "$PYTHON_VERA_WRAPPER_BIN")" +MY_BINARY="$(basename "$PYTHON_VERA_WRAPPER_BIN")" + +pushd "$MY_BASEPATH" > /dev/null + pipenv run ./"$MY_BINARY" -m "$MOUNT_PATH" -v "$VERA_DRIVE_NAME" -n "$USB_DRIVE_PART_NAME" "$VERA_CONTAINER_PATH_REL" +popd > /dev/null