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.

Revisions

  1. dalanlan created this gist Aug 19, 2015.
    12 changes: 12 additions & 0 deletions expect.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/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