Advertisement
Guest User

Untitled

a guest
Apr 10th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. HOST="172.16.0.243"
  5. USER="root"
  6. PASS=""
  7. #CMD=$@
  8. CMD='/vmfs/volumes/iscsi_lun0/ghetto_243/ghettoVCB.sh -a -d debug -e /vmfs/volumes/iscsi_lun0/ghetto_243/vm_exclusion_list -g /vmfs/volumes/iscsi_lun0/ghetto_243/ghettoVCB.conf > /vmfs/volumes/iscsi_lun0/ghetto_243/backup_243.log'
  9.  
  10.  
  11.  
  12. VAR=$(expect -c "
  13. set timeout 30
  14. spawn ssh -o StrictHostKeyChecking=no $USER@$HOST $CMD
  15. match_max 100000
  16. expect \"*?assword:*\"
  17. send -- \"$PASS\r\"
  18. send -- \"\r\"
  19. expect eof
  20. ")
  21. echo "==============="
  22. echo "$VAR"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement