I am new to bash and expect.
Now I have a expect script:
When I run this script I got:
set HOST "server"
set USER "roxsoft"
set PASS "***"
set PATH "/home/roxsoft/www/"
spawn sshfs "$USER@$HOST:" "/media/server-ssh"
expect "Are you sure you want to continue connecting (yes/no)? yes"
expect "roxsoft@server's password:"
spawn sshfs roxsoft@server: /media/server-ssh
Warning: the DSA host key for 'server' differs from the key for the IP address '169.254.43.84'
Offending key for IP in /home/roxsoft-server/.ssh/known_hosts:1
Matching host key in /home/roxsoft-server/.ssh/known_hosts:2
Are you sure you want to continue connecting (yes/no)? yes
roxsoft@server's password: :$
The problem is:
sometimes I can't access /media/server-ssh directory after running this script.
sometimes I can access /media/server-ssh but I can see only empty folder... (ie: server folder was not mounted...)
If I run this manually I got everything working fine..
sshfs "USERNAME@$__IP__:" "/media/server-ssh"
Whats wrong with this?????