Last active
September 15, 2020 13:20
-
-
Save in-in/a69c34c3c1c038bf2083f6614d115f66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# veracrypt_mount.sh | |
# how to run | |
# chmod u+x veracrypt_mount.sh && sudo ./veracrypt_mount.sh | |
USER_HOME=$(eval echo ~"${SUDO_USER}") | |
VOLUME_NAME='storage' | |
VOLUME_PATH='/dev/sda3' | |
CRYPTTAB='/etc/crypttab' | |
FSTAB='/etc/fstab' | |
mkdir -p "$USER_HOME/$VOLUME_NAME" | |
echo "$VOLUME_NAME $VOLUME_PATH none tcrypt-veracrypt" >> "$CRYPTTAB" | |
echo "/dev/mapper/$VOLUME_NAME $USER_HOME/$VOLUME_NAME ext4 nosuid,nodev,nofail 0 0" >> "$FSTAB" | |
tail -1 "$CRYPTTAB" | |
tail -1 "$FSTAB" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment