Skip to content

Instantly share code, notes, and snippets.

@dalanlan
Created August 19, 2015 05:15
Show Gist options
  • Save dalanlan/6dc55494380f3957a98d to your computer and use it in GitHub Desktop.
Save dalanlan/6dc55494380f3957a98d to your computer and use it in GitHub Desktop.
#!/bin/bash
ip="$1"
/usr/bin/expect <<-EOF
set timeout 3
spawn ssh vcap@$ip
expect {
"yes/no" {send "yes\r";exp_continue}
"password" {send "password\r";exp_continue}
"login" {send "sudo mkdir -p /varlog && sudo touch -f /var/log/es-kubelet.log.pos && sudo touch -f /var/log/es-containers.log.pos\r";exp_continue}
eof exit
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment