Guest User

Untitled

a guest
Jun 14th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #!/usr/bin/expect -f
  2.  
  3. # effectue le transfert par SCP (sur SSH)
  4. set timeout 3600
  5.  
  6. set localfile [lindex $argv 0]
  7. set distfile [lindex $argv 1]
  8. set servername [lindex $argv 2]
  9. set password [lindex $argv 3]
  10.  
  11. spawn scp $localfile $servername:$distfile
  12. expect "password:"
  13. send -- "$password\r"
  14. expect "100%"
  15. exit 0
Add Comment
Please, Sign In to add comment