echo "We have discovered Encrypted filesystems, do you want to mount them now ?" MSG=`gprintf "Press Y within %%d seconds to mount your encrypted filesystems..."` KEYS=`gprintf "yY"` if /sbin/getkey -c $AUTOFSCK_CRYPTO_TIMEOUT -m "$MSG" "$KEYS"; then echo -e '\n' #We *really* don't want to boot up without this mounting successfully, so give #10 chances for the user to type the passphrase. If there is more than one #encrypted partition, try the same passphrase before making the user re-type it. unset crypto_passphrase for i in ${encrypted}; do failcount=0 while [ $failcount -lt 10 ] ;do if [ -z "$crypto_passphrase" ];then read -s -p "Enter passphrase for encrypted partition(s) ${i}: " crypto_passphrase echo -e '\n' else echo "Trying the same passphrase for encrypted partition ${i}" fi echo "$crypto_passphrase" | mount -p0 ${i} ; result=$? if [ $result == 0 ];then echo "Successfully mounted encrypted partition ${i}" break else let failcount++ echo "Failed to mount ${i}; used $failcount attempt(s) out of 10 allowed." fi unset crypto_passphrase done done unset crypto_passphrase else echo -e '\n' fi