Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- HOST="172.16.0.243"
- USER="root"
- PASS=""
- #CMD=$@
- 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'
- VAR=$(expect -c "
- set timeout 30
- spawn ssh -o StrictHostKeyChecking=no $USER@$HOST $CMD
- match_max 100000
- expect \"*?assword:*\"
- send -- \"$PASS\r\"
- send -- \"\r\"
- expect eof
- ")
- echo "==============="
- echo "$VAR"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement