Created
July 17, 2019 14:17
-
-
Save mdzidic/a144523e6f24b9a80bf08c6e99cf3d10 to your computer and use it in GitHub Desktop.
Mount and decrypt multiple directories at once
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 | |
DEST="/mnt" | |
PASS="PassForDecryption" | |
for i in ./* ; do | |
if [ -d "$i" ]; then | |
SRC=$(basename "$i") | |
echo Mounting $SRC to $DEST/$SRC | |
sudo mount -t ecryptfs -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=no,passwd=$PASS $SRC $DEST/$SRC | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment