I have a bash script that mounts a filesystem with password using expect as shown here:
Code:
spawn -ignore HUP /usr/bin/sshfs <filesystem> <mountpoint>
expect "assword:"
send "blahblahblah"
expect eof
First, I understand the many issues with doing this (security, etc), but it is absolutely necessary for certain reasons.
This script used to work perfect every time, but about a month ago stopped working about 90% of the time. When I run the script manually, I can see that it is sending the password about 1-2 seconds before the password prompt.
Does anyone have an idea as to why the expect would not wait until getting that queue before sending? Thanks in advance!