VeraCrypt: füge Beispiel-Skript zum Mounten hinzu

This commit is contained in:
Christopher Spinrath 2018-07-17 11:01:04 +02:00
parent f767de7c83
commit 45caf8984e
1 changed files with 39 additions and 0 deletions

View File

@ -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