Last active
August 2, 2019 18:40
-
-
Save David-Lor/0bd7e23364196df9c8e7c6d69f5ff9d7 to your computer and use it in GitHub Desktop.
CryFS mount/unmount scripts
This file contains hidden or 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 | |
| set -e | |
| CRYFS_DIR="$1" | |
| CRYFS_DIR_NAME=$(basename "${CRYFS_DIR}") | |
| CRYFS_MOUNT_DIR="$HOME/cryfs_${CRYFS_DIR_NAME}" | |
| if [ -z "${CRYFS_DIR}" ] | |
| then | |
| echo "No route specified!" | |
| exit 1 | |
| fi | |
| echo "Creating mount directory at ${CRYFS_MOUNT_DIR}..." | |
| mkdir -p "${CRYFS_MOUNT_DIR}" | |
| echo "Mounting using cryfs, please follow the instructions..." | |
| cryfs "${CRYFS_DIR}" "${CRYFS_MOUNT_DIR}" | |
| echo "All done!" |
This file contains hidden or 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 | |
| set -e | |
| CRYFS_DIR="$1" | |
| CRYFS_DIR_NAME=$(basename "${CRYFS_DIR}") | |
| CRYFS_MOUNT_DIR="$HOME/cryfs_${CRYFS_DIR_NAME}" | |
| if [ -z "${CRYFS_DIR}" ] | |
| then | |
| echo "No route specified!" | |
| exit 1 | |
| fi | |
| echo "Unmounting directory at ${CRYFS_MOUNT_DIR}..." | |
| fusermount -u "${CRYFS_MOUNT_DIR}" | |
| echo "Removing mount dir..." | |
| rmdir "${CRYFS_MOUNT_DIR}" | |
| echo "All done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment