Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ip1=192.168.1.1 # Replace with your IP address or DNS name, user name, port etc.
- user1=somelogin
- aut1='-o PasswordAuthentication=no'
- port1='-p 59184'
- ip2=192.168.1.2 # Replace with your IP address or DNS name, user name, port etc.
- user2=somelogin
- pass2='-o password_stdin'
- port2='-p 59184'
- aut2='-o workaround=rename'
- dir1=/some/remote/source/ # Replace with the directory on the remote computer
- dir2=/home/remotelogin/
- r=1
- c=0
- until [ $r = 0 ]
- do
- if test $c -gt 120
- then
- exit 1
- fi
- ping -c 2 $ip1
- r=$?
- c=`expr $c + 1`
- sleep 5
- done
- sshfs $user1@$ip1:$dir1 /home/localuser/SSHFSFOLDER $port1 $aut1 # Replace with your local folder path
- r=1
- c=0
- until [ $r = 0 ]
- do
- if test $c -gt 120
- then
- exit 1
- fi
- ping -c 2 $ip2
- r=$?
- c=`expr $c + 1`
- sleep 5
- done
- echo mypassword | sshfs $user2@$ip2:$dir2 /home/localuser/SSHFSFOLDER2 $port2 $aut2 $pass2 # Replace with your local folder path and your password!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement