Skip to content

Instantly share code, notes, and snippets.

@mdzidic
Created July 17, 2019 14:17
Show Gist options
  • Save mdzidic/a144523e6f24b9a80bf08c6e99cf3d10 to your computer and use it in GitHub Desktop.
Save mdzidic/a144523e6f24b9a80bf08c6e99cf3d10 to your computer and use it in GitHub Desktop.
Mount and decrypt multiple directories at once
#!/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