Hi all,
I am new to bash and expect.
Now I have a expect script:
Code:
#!/usr/bin/expect -f
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"
send "yes\r"
expect "roxsoft@server's password:"
send "$PASS\r"
exit
When I run this script I got:
Code:
:$ ~/server-ssh.sh
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..
Code:
sshfs "USERNAME@$__IP__:" "/media/server-ssh"
Whats wrong with this?????
Bookmarks