Last active
June 17, 2016 14:11
-
-
Save wrzlbrmft/07a9b788e43cf7a1a14d5d5581d90c03 to your computer and use it in GitHub Desktop.
Mounts and unmounts EncFS by taking folder name out of script's file name.
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
#!/usr/bin/env bash | |
# to be used as symlink, e.g. ./foobar-mount.sh -> ~/bin/_enc-mount.sh | |
# will mount encrypted dir ./.foobar to mount point ./foobar | |
SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
SCRIPT_FILE="$(basename "${BASH_SOURCE[0]}")" | |
SCRIPT_NAME="${SCRIPT_FILE%.*}" | |
ENC="${SCRIPT_NAME%-*}" | |
encfs "$SCRIPT_PATH/.$ENC" "$SCRIPT_PATH/$ENC" |
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
#!/usr/bin/env bash | |
# to be used as symlink, e.g. ./foobar-umount.sh -> ~/bin/_enc-umount.sh | |
# will unmount encrypted dir ./.foobar from mount point ./foobar | |
SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
SCRIPT_FILE="$(basename "${BASH_SOURCE[0]}")" | |
SCRIPT_NAME="${SCRIPT_FILE%.*}" | |
ENC="${SCRIPT_NAME%-*}" | |
fusermount -u "$SCRIPT_PATH/$ENC" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment