Реализован ниже сценарий, который решил мою проблему. Любые лучшие предложения, пожалуйста, дайте мне знать.
#!/bin/bash
#Argument 1 will be the mountphrase
mountphrase=$1
echo $mountphrase
echo "passphrase_passwd=${mountphrase}" > /home/testpc/key.txt
#Add tokens into user session keyring
printf "%s" "${mountphrase}" | ecryptfs-add-passphrase - > tmp.txt
#Now get the signature from the output of the above command
sig=`tail -1 tmp.txt | awk '{print $6}' | sed 's/\[//g' | sed 's/\]//g'`
echo $sig
rm -f tmp.txt #Remove temp file
#Now perform the mount
sudo mount -t ecryptfs -o key=passphrase:passphrase_passwd_file=/home/testpc/key.txt,no_sig_cache,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_enable_filename=y,ecryptfs_passthrough=n,ecryptfs_enable_filename_crypto=y,ecryptfs_fnek_sig=${sig},ecryptfs_sig=${sig},ecryptfs_unlink_sigs /home/testpc/Ecryptfs/secure5 /home/testpc/Ecryptfs/secure5
rm -rf /home/testpc/key.txt
Пожалуйста, сделайте обзор и дайте мне знать ваши комментарии.